Can i ask for some advice about securing ssh logins.

Is this a good way.

I want to have only one user allowed to connect to our remote servers(AllowUser in sshd.conf)Using ssh keys and NoPasswords. This user connect to a restricted shell withn a chroot, the only command allowed is su - (Own User)

Does this work and how would i go about the latter part.

Thanks in advance.

1 Answer 1


You cannot su within chroot - to do so would invalidate the whole point of the chroot mechanism, which is isolation.

The closest I think you could come to implementing this, is to login chrooted, and then login again to localhost as the user, via ssh or similar.

You could then run another sshd on a separate port, or otherwise restrict the login location to be "localhost only".

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .