"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
When I add
However, when I replace the above with
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.