I'm trying to give someone ssh access to a (Ubuntu 14.04) server I've got, but I want to limit them to their own home folder. So I'm trying to follow this tutorial.
I first created a user (
sudo adduser jailuser) which made it possible to log in using jailuser. Then proceeding to trying to jail the user, I added the following to
/etc/ssh/sshd_config (and restarted ssh):
Subsystem sftp internal-sftp Match Group sftp ChrootDirectory %h ForceCommand internal-sftp AllowTcpForwarding no
I then created the group sftp:
sudo groupadd sftp
and ran the following commands to change the jailuser:
sudo usermod -G sftp jailuser sudo usermod -s /bin/false jailuser sudo chown root:root /home/jailuser sudo chmod 0755 /home/jailuser
The result is that I cannot log in anymore:
ssh: connect to host xx.xxx.xx.223 port 22: Connection refused.
Since I'm kind of a newbie with server management I'm lost here. Does anybody know what I'm doing wrong? All tips/tricks are welcome!