If you want to restrict a user to only their home directory while using sftp or ssh, you will want to first restrict the user to their home directory.

First change the users shell to rbash, then jail them into their home directory.

cd /bin; ln -s bash rbash

edit /etc/shells, and add a line /etc/rbash at the end.

usermod -s /bin/rbash -d /home/username/./ username

Categories: Uncategorized

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *