Thursday, March 19, 2020

Using sudo with WinSCP


This was specifically for HP-UX, so kornshell (KSH), but can be used for Linux with bash when you don't want users to login directly using a service account.  You will also need to give sudo rights in the sudoers file like normal, but many people don't realize that you can use sudo with WinSCP as shown below.

I think you may also need to adjust an SSH setting related to requiring a TTY if it doesn't work for you.
It would need to be changed to
Defaults !requiretty




sudo notes:
dparker         ALL = (ALL)ALL, !SU
HELPDESK        ALL = ALL, !SU
The first ALL represents the users allowed to run the command (this can be an individual or group)
The second ALL represents the hosts
The third ALL is the target (who you are when running the command)
The last ALL is the group of commands allowed