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.

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)


Topic review


Re: Can't get sudo su - userid to work

This is more sudo question than WinSCP question.
See sudo man page:
There are the -U and -u switches to specify the target username.

Can't get sudo su - userid to work

I have run around and around with the different options in the FAQs and forum posts. None of them fit my situation closely enough for me to adapt.

If I use PuTTY, I log in with a ppk RSA key file. Then I use "sudo su - userid" to change to the higher privileged user. When I do that command, I do NOT have to enter a password.

So, for the SFTP setting, there is a sample that reads like
"su -c /bin/sftp-server" so that's missing the userid and the sudo

There is a popular link on StackOverflow that shows:
"sudo su -c /usr/lib/sftp-server" which is still missing the userid

I though it might be a formatting problem, so I created a script with just

in it and it worked to connect as my normal user. if i added the sudo line like this:
sudo su - userid


then it just hangs

So my question is: Can I do the equivalent of "sudo su - userid" and then launch sftp-server?