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
0 Comments