How I can edit files with WinSCP on Ubuntu 14.04? Since I can not login as root or elevate privileges

Error: Permissions Denied, you can not overwrite the file


you can only edit files you have the Write right to. If the file you wish to edit does not permit you the rights you seek, you must contact the system administrator.

if you need to alter the permissions on the file to allow write and you have SSH access and sudo capability, you can use

sudo chmod o+w /path/to/file

and then revert it later with:

sudo chmod o-w /path/to/file

If you can't elevate perms, you have one other possible choice. Remember that if you have write permissions to a directory, you can add/rename files there.

IF you have perms to the directory I'd do something like:

edit /path/to/file/filename.new

mv /path/to/file/filename /path/to/file/filename.sav
mv /path/to/file/filename.new

If you don't have perms to the directory, and you don't have ability to elevate perms, you're SOL.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.