Hi guys. I'm trying to configure SSH to Chroot my users. I'm following the instructions found here: http://www.howtoforge.com/chrooted_ssh_howto_debian. I'm using CentOS instead of Debian, but I think I've sufficiently adapted the instructions. The problem I'm having is toward the end. I followed all the instructions and as far as I can tell everything works fine, but when I attempt to ssh and log in as the test user I created - the one the guide walked me through setting up - it tells me that it can't find /bin/bash and kills the connection. I checked in /bin and bash is there (obviously). I also checked in the /home/chroot/bin and bash is there. I'm not sure what I missed, but I followed the instructions very carefully, using copy and paste whenever possible to prevent typos, and each time I get the same result. I've even tried various alternates in the user settings for the shell. I've tried /home/chroot/bin/bash; /home/chroot/./bin/bash; and so on... all with the same result. Here's a more detailed output: http://pastebin.com/m4f24eccc If anyone can help me figure this out, I would be very thankful! It's not super super urgent, since I have other things I need to focus on today, but I'd like to be able to finish this up on Monday if at all possible. Thanks for your help.
you know.... some times I just forget the obvious.... checking........ maybe it has something to do with pam. From /var/log/secure: Feb 5 10:54:24 localhost sshd[29765]: Accepted password for testuser from 10.0.0.39 port 53582 ssh2 Feb 5 10:54:24 localhost sshd[29765]: pam_unix(sshd:session): session opened for user testuser by (uid=0) Feb 5 10:54:24 localhost sshd[29767]: pam_env(sshd:setcred): Unable to open config file: /etc/security/pam_env.conf: No such file or directory Feb 5 10:54:24 localhost sshd[29765]: pam_unix(sshd:session): session closed for user testuser Code (markup):
Hi, Check /etc/security/pam_env.conf file. If exist than check for user rights. Maybe your user don't have right to read pam_env.conf file. Rudolf Bodocsi
Did you run their little script they provided? What that does is copy the binaries / libraries needed to the new jailed environment.. you said the bash binary was indeed in /home/chroot/bin? What happens if you change your login shell to something else such as sh?