SFTP: Sudo on login for WinSCP: add server command / protocol option, like for built-in SFTP
0 vote
Hello,
What is missing exactly?
Regards
David Hervieux
Described in the 2nd link: You recently added an option for the built-in SFTP server to specify a "Server start command" (SFTP Built-in - General - Advanced tab).
Described in the 1st link: I would like the same for WinSCP: A way to specify the SFTP server protocol option: "sudo /usr/lib/openssh/sftp-server". So I can connect to the server with full root permissions.
Hello,
I don't think that WinSCP command line support that. Have you verified if we can send a custom command?
Regards
David Hervieux
No I didn't, but I went to https://winscp.net/eng/docs/commandline and figured it out. This batchfile works for me, so yes, it is possible.
cd "C:\Program Files (x86)\WinSCP"
WinSCP.exe sftp://user@host/^
/privatekey=<path-to-putty-private-key>^
/rawsettings "SftpServer=sudo /usr/lib/openssh/sftp-server"
Hello,
Could you try entering /rawsettings "SftpServer=sudo /usr/lib/openssh/sftp-server" in the "other parameters" field of your WinSCP entry? The "other parameters" field is made as a versatile field when the option you are looking for isn't directly available. Let me know if this works.
Regards,
Hubert Mireault