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

OrionRed

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 thought it might be a formatting problem, so I created a script with just
/usr/lib/sftp-server

in it and it worked to connect as my normal user. If I added the sudo line like this:
sudo su - userid
/usr/lib/sftp-server

then it just hangs

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