Friday, October 7, 2016

Using Winscp as Sudo User to edit files remotely - Ubuntu 16.04

On the new version of Ubuntu Server 16.04 , you cannot have a root user account but you can create a user account with root privileges only when strat your command with sudo, And that made it very difficult for people who are using Winscp as their daily tool to interact with a headless server to edit files and save them , you will get an error  message  saying "Permission Denied".

After Searching google for a suitable solution for this problem, I didn't find anything related directly to Ubuntu 16.04.
The direct dirty trick is to give the ubuntu user the full  root privileges by editing sudoers file "/etc/sudoers", then add the following line at the end of the file :

username ALL=NOPASSWD: ALL

Change username by the account name you are using to login to the system through Winscp.
On the client side choose advanced and sftp and insert the location of sftp server
sudo /usr/lib/openssh/sftp-server in case of ubuntu 16.04


Reference credits goes to chilcano

No comments:

Post a Comment