SCP login hangs with "su" command

Advertisement

brooky
Donor
Joined:
Posts:
8
Location:
Cambridge, UK

SCP login hangs with "su" command

If I login to my server as root using SSH keys over SCP (not SFTP) without password I would expect to be able to use the console to change user.

Say for example I have 100 hosting accounts on the server and I want to login as that user. The most efficient way is to login as root then "su username".

With shell access for that user disabled the console correctly tells me that shell isn't allowed. If it is allowed it hangs. Screenshot attached.

Annotation 2020-12-08 165144.png

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
40,603
Location:
Prague, Czechia

Re: SCP login hangs with "su" command

This is not possible. You cannot execute shell commands in an SFTP session. The "Console" actually opens a separate shell session:
https://winscp.net/eng/docs/shell_session
Even if you succeeded in doing "su" there, it would have no effect on the SFTP session.
There's no way to change the user in a middle of SFTP session.
See also https://winscp.net/eng/docs/faq_su

Reply with quote

Advertisement

You can post new topics in this forum