Open files in Ubuntu as ROOT from WinSCP remotely

I would like to share a tip, frequently we need modify protected files (i.e. in an Ubuntu box) from WinSCP remotely, but sometimes that is impossible.

If you have a non-privileged user and want to edit a root protected file of an Ubuntu box but with WinSCP, you can do it with a few changes.


1. Server:

– Ubuntu 11.04
– Non-privileged user: chilcano

2. Client:

– Any S.O. but with WinSCP 4.3.6 (


1. In the server side add this line to /etc/sudoers

chilcano@sso1:/$ sudo nano /etc/sudoers


#### added
chilcano ALL=NOPASSWD: /usr/lib/openssh/sftp-server

2. In the client side open WinSCP and do the following

Check SFTP protocol in WinSCP and Add customized command to sftp-server in Ubuntu


3. Test it, open a protected file and modify. You could do changes on it.

Open as ROOT from WinSCP


I hope this help you.