I've been following this tutorial http://olivier.sessink.nl/jailkit/howtos_chroot_shell.html to setup a chroot jail for my ssh users.
My sshd_config has this in it:
Match group backup-users
ChrootDirectory /home/jail/
But what happens when I log in is that the ssh connection gets terminated immediately.
The /var/log/auth.log says:
Jul 13 19:37:02 obu1 sshd[21225]: Accepted password for testuser from ###.###.###.### port 63718 ssh2 Jul 13 19:37:02 obu1 sshd[21225]: pam_unix(sshd:session): session opened for user testuser by (uid=0) Jul 13 19:37:03 obu1 sshd[21225]: pam_unix(sshd:session): session closed for user testuser
What am I doing wrong?
output of attempted ssh:
jerome@obu1:~$ ssh localhost -p 222 -l testuser testuser@localhost's password: Linux hostname 2.6.26-2-amd64 #1 SMP Sun Jun 21 04:47:08 UTC 2009 x86_64 The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. Last login: Mon Jul 13 20:08:55 2009 from localhost Connection to localhost closed. jerome@obu1:~$
is there a copy of the user's shell inside the jail?
Do you check the permissions for the home folder? That kind of error happens to me when permissions are wrong.