This is an old revision of the document!
How do I change a user after login (e.g. su root)?
SFTP protocol does not allow this.
With SCP protocol it is possible, but only if you are allowed to do sudo su
without being prompted with password. See sudo
documentation to learn how to do that. Then you can specify sudo su
(or sudo su <username>
) as custom shell on SCP tab of Login dialog.
MORE: in the Environment setting, SCP screen. Change the shell from default to ENTER. then type: /bin/bash -c “sudo su”
Advertisement
You must have the dash C and the quotes to make this work. Try and copy/paste the line as I typed it.
Hit SAVE and call it: sudo session
Now open the saved sesssion called: sudo session and enter the hostname or IP address and hit save again. give it the name of your server and add the word sudo at the end to identify this session as a sudo connection.
If you have all the correct rights in the sudoers file to run sudo su without a password, then this configuration will get you into the linux box and give you full rights while in WINSCP. Happy Copying :)