I have a Debian Wheezy server where i would like to chroot certain users when they log in via the openssh server. I am getting an odd error however: For test purposes i have simply added
ChrootDirectory /data/
To my sshd_config file (And restarting the server)
When i attempt to log in via putty, the window simply closes without an error message. When i try to use the openssh-client from the server to itself, i get this error:
ssh testuser@localhost
testuser@localhost's password:
Last login: ....
/bin/bash: No such file or directory
Connection to localhost closed
the /data/ directory is owned by root:root and has 755 permissions. If i try to add a /data/testuser dir with the same permissions, the same error occurs.
There is no trace of either attempt in auth.log.
If i remove the chroot line from the sshd_config and restart the server, i am allowed to log in normally both via putty and the openssh-client.
Why am i getting this error? I do not understand it.