I followed multiple guides on the internet on how to restrict a user so that he cannot change/see files outside of his home directory.
So I created a user, let's call him john and I also created a group called sftp which is his primary group. I also updated his home directory to the directory I'd like him to be jailed to. (In that case
Then I added some configuration lines to
Match Group sftp ChrootDirectory %h ForceCommand internal-sftp AllowTcoForwarding no
Didn't work with this. John was able to access the directorys outside of his home directory. Then I tried to make it user specific.
Match User john ChrootDirectory /var/www ForceCommand internal-sftp AllowTCPForwarding no X11Forwarding no
Didn't work either and john could access still all files. So I even tried to use both configurations but none worked.
Johns shell is
/bin/bash although it was mentioned in some guides to set it to
/bin/nologin but of course then I cannot connect with Filezilla for instance.
The distribution is Ubuntu 14.04.