SSH Linux Mint – How to Have a Restricted SSH User Without Totally Limiting SSH Access

linux-mintssh

I am working on making a new user with SSH access to my server for file sharing purposes via WinSCP. My goal was to restrict them to their home directory by having their default shell be rbash, but when I do this it won't let me connect to the server and it will stop at the "Connecting to Host…" message. I can connect with this user when the shell is set to the default shell. Is there a permission that I need to modify to get around this?

There is an entry in /etc/shells for rbash.

edit

Best Answer

Shell access typically requires shared system binaries and libraries. Limiting a user to only their home directory is unlikely to be usable (i.e. the user in question won't be able to do much).

If you want the user to run a certain program, you could set their login shell to that program. Git does this with git-shell for example.

In general on a multi-user system, it is a good idea to make home directories not world readable (such as by setting an appropriate umask, or adjusting home directory permissions).

Related Question