0

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:~$

Malfist
  • 797
  • 3
  • 9
  • 21
  • Is this a duplicate of http://serverfault.com/questions/39997/how-can-i-chroot-ssh-connections ? – davr Jul 13 '09 at 22:44
  • No, the other asked how to get ssh working with a chroot jail, not how to setup the said chroot jail. – Malfist Jul 14 '09 at 13:13

2 Answers2

2

is there a copy of the user's shell inside the jail?

Cian
  • 5,777
  • 1
  • 27
  • 40
0

Do you check the permissions for the home folder? That kind of error happens to me when permissions are wrong.

hdanniel
  • 4,253
  • 22
  • 25