Differences
This shows you the differences between the selected revisions of the page.
2008-02-10 | 2008-04-09 | ||
no need to run sudo thought shell (martin) | 4.1 Custom command to execute SFTP server binary may be specified. This allows using su to run SFTP server. (martin) | ||
Line 10: | Line 10: | ||
In some cases you may be able to use ''[[http://www.gratisoft.us/sudo/man/sudo.html|sudo]]'' command straight after login to change a user, before file transfer session starts. | In some cases you may be able to use ''[[http://www.gratisoft.us/sudo/man/sudo.html|sudo]]'' command straight after login to change a user, before file transfer session starts. | ||
- | [[protocols#sftp|SFTP]] and [[protocols#ftp|FTP]] protocols do not allow this. | + | [[protocols#ftp|FTP]] protocol does not allow this. |
- | The [[protocols#scp|SCP protocol]] allows for this, but the actual method is platform dependant (to switch to SCP protocol, see //[[ui_login_session#protocol_group|Session tab]]// of Login dialog). | + | The [[protocols#scp|SFTP]] and [[protocols#scp|SCP]] protocols allow for this, but the actual method is platform dependant. |
- | If you are connecting to a Unix/Linux server, you can specify following command as custom shell on the //[[ui_login_scp#shell|SCP/Shell tab]]// of Login dialog: | + | With SFTP protocol, you can use //[[ui_login_sftp#protocol_options|SFTP server]]// option on //SFTP tab// of Login dialog to execute SFTP binary under different user. Under Unix/Linux with OpenSSH server, you can specify: |
+ | |||
+ | sudo su -c /bin/sftp-server | ||
+ | |||
+ | With SCP protocol under Unix/Linux server, you can specify following command as custom shell on the //[[ui_login_scp#shell|SCP/Shell tab]]// of Login dialog: | ||
sudo su - | sudo su - | ||
- | You can do this only if you are allowed to do ''sudo su'' without being prompted with password. See ''[[http://www.gratisoft.us/sudo/man/sudo.html|sudo]]'' documentation to learn how to do that. For example you can add following line to ''[[http://www.gratisoft.us/sudo/man/sudoers.html|sudoers]]'' file (''/etc/sudoers''): | + | You can do the above only if you are allowed to do ''sudo su'' without being prompted with password. See ''[[http://www.gratisoft.us/sudo/man/sudo.html|sudo]]'' documentation to learn how to do that. For example you can add following line to ''[[http://www.gratisoft.us/sudo/man/sudoers.html|sudoers]]'' file (''/etc/sudoers''): |
yourusername ALL=(ALL) NOPASSWD: ALL | yourusername ALL=(ALL) NOPASSWD: ALL | ||
Note that as WinSCP does not allocate TTY, you need to have ''sudoers'' option ''requiretty'' turned off (what is default). | Note that as WinSCP does not allocate TTY, you need to have ''sudoers'' option ''requiretty'' turned off (what is default). |