I was wanting to use scp to move some files and overwrite any existing instances of these files on the destination server. Some of them may be read only which, of course, courses the scp to fail with permission denied. I couldn't seem to find a --force type switch for scp; is this possible? I am aware of rsync but this is not currently available on the destination server.
scp force overwrite read only files
scp
You cannot modify/overwrite any file if you don't have write permission, and no possible scp option may change that. In order to solve it you should connect to the server first (using ssh for instance) and modify the permission on your file. If you don't know how to do it, here's a simple command which does the trick:chmod +w /path/to/your/fileA few notes:There's probably a reason why these files are read-only. Before doing anything, make sure you know why and that changing this is not going to break anything or introduce security holes.If necessary you could remove the write permission after executing your scp command (with this: chmod -w /path/to/file).If there are too many files with read-only permission, you need to hunt them down. find (at least the GNU version available in most Linux distributions) has a -perm test which you can use (man find for more info).Someone might suggest that you connect as root or use sudo. It'll work, but for the love of God don't. I cannot begin to tell you how wrong this would be.