How to Run Sudo Command in Winscp to Transfer Files from Windows to Linux

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.

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.

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.

copy /move the Data from the Linux Command line to local windows

To log into your cygwin instance remotely, you need to install the sshd module in cygwin and then set it up. Then you will be able to use the ssh command on your linux/unix machine to do one of many things:

open a bash shell in your cygwin instance
execute a remote command from linux/unix using: ssh WINDOWS_SERVER command
copy to the Windows machine remotely using scp or sftp.

How do I open a WinSCP GUI session from command line?

WinSCP has two executables, winscp.exe and winscp.com. The winscp.exe is GUI, while the winscp.com is command-line.

If you use just the winscp, due to an extension precedence in Windows, the .com wins. Make sure you use a full GUI executable name:

winscp.exe hpc

References:

https://winscp.net/eng/docs/executables

https://winscp.net/eng/docs/commandline

Is there a WinSCP equivalent for Linux?

If you're using GNOME, you can go to: PlacesConnect to Server in Nautilus and choose SSH. If you have an SSH agent running and configured, no password will be asked!
(This is the same as sftp://root@servername/directory in Nautilus)

In Konqueror, you can simply type: fish://servername.

Per Mike R: In Ubuntu 14.04 (with Unity) it’s under FilesConnect to Server in the menu or NetworkConnect to Server in the sidebar.



Related Topics



Leave a reply



Submit