Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

rmccullough

I know very little about Linux... I've gotten to this through a lot of Google-fu.

Also, why sudo su -c /usr/lib/openssh/sftp-server and not just sudo /usr/lib/openssh/sftp-server?

Good question... I just modified the entry from the dropdown menu with the actual path to the sftp-server. I just changed it to sudo /usr/lib/openssh/sftp-server and it's now working fine.
martin

Re: "Use sudo on Login" issue. Unable to restrict to only sftp-server

I'm no expert in sudo, but when you do sudo su -c something, isn't the command that you add to sudoers the su -c something and not just something? I understand that you claim that it works on command-line – can you double check that?

Also, why sudo su -c /usr/lib/openssh/sftp-server and not just sudo /usr/lib/openssh/sftp-server?
rmccullough

"Use sudo on Login" issue. Unable to restrict to only sftp-server

Server info:
Ubuntu 20.04
SSH is configured to only accept passwordless login using a Private Key.
Only the my non-root user is allowed to connect via SSH.

Followed this: https://winscp.net/eng/docs/faq_su

Added sudo su -c /usr/lib/openssh/sftp-server to the SFTP server field in the Advanced Site Settings. Screenshot below.

When I add [username] ALL=NOPASSWD: ALL to sudoers, WinSCP can connect just fine. Running sudo su -c /usr/lib/openssh/sftp-server via PuTTY session prompts for pw.

However, when I replace the above with [username] ALL=NOPASSWD: /usr/lib/openssh/sftp-server it will fail to connect. Screenshot below. Running sudo su -c /usr/lib/openssh/sftp-server via PuTTY session does not prompt for a password and starts the service.