Switching Users Using Winscp Between Different Accounts

Switching users using WinSCP between different accounts

There is a FAQ for this question on WinSCP site:

How do I change user after login (e.g. su root)?

You need to specify the sudo command in WinSCP session settings, as custom shell (if you are using SCP) or use sudo in custom SFTP server startup command (if you are using SFTP).

Though there are some limitations, notably that you need to configure sudo not to require a password.

See the link for details.

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

AFAIK you can't do that.
What I did at my place of work, is transfer the files to your home (~) folder (or really any folder that you have full permissions in, i.e chmod 777 or variants) via WinSCP, and then SSH to to your linux machine and sudo from there to your destination folder.

Another solution would be to change permissions of the directories you are planning on uploading the files to, so your user (which is without sudo privileges) could write to those dirs.

I would also read about WinSCP Remote Commands for further detail.

WinSCP/CuteFTP - Download files owned by another user

When you connect via Putty switch to user by using your sudo privilege. Then copy file under /tmp folder. After that you would be able to download that file via winscp/cuteFTP.

Transfer files to/from session I'm logged in with PuTTY

This is probably not a direct answer to what you're asking, but when I need to transfer files over a SSH session I use WinSCP, which is an excellent file transfer program over SCP or SFTP. Of course this assumes you're on Windows.



Related Topics



Leave a reply



Submit