How to run SUDO command in WinSCP to transfer files from Windows to linux

PC2015 picture PC2015 · Jan 14, 2016 · Viewed 110.1k times · Source

I am trying to use WinSCP to transfer files over to a Linux Instance from Windows.

Im using private key for my instance to login to Amazon instance using ec2-user. However ec2-user does not have access to write to the Linux instance

How do i sudo su - to access the root directory and write to the linux box, using WinSCP or any other file transfer method?

Thanks

Answer

Pelly picture Pelly · Jun 21, 2018

I know this is old, but it is actually very possible.

  • Go to your WinSCP profile (Session > Sites > Site Manager)

  • Click on Edit > Advanced... > Environment > SFTP

  • Insert sudo su -c /usr/lib/sftp-server in "SFTP Server" (note this path might be different in your system)

  • Save and connect

Source

AWS Ubuntu 18.04: enter image description here