Fw: howto use chroot + sshd

Terry Tsang kunwins at uplooking.com
Sun Jun 7 18:16:34 EST 2009



Hi everybody.
I got a problem here.

I want to use chroot + sshd service.
env:
RHEL 5.2

tail -1 /etc/pam.d/sshd
session   required    pam_chroot.so debug

tail /etc/security/chroot.conf
terry           /users


ssh  terry at 192.168.20.11  faile
tail /var/log/secure

Jun  7 05:05:40 node1 sshd[5397]: pam_chroot(sshd:session): chroot(/users) succeeded            <- chroot /users succeeded
Jun  6 21:05:40 node1 sshd[5397]: pam_unix(sshd:session): session closed for user terry
Jun  6 21:05:40 node1 sshd[5399]: pam_env(sshd:setcred): Unable to open config file: /etc/security/pam_env.conf: No such file or directory
Jun  6 21:05:40 node1 sshd[5397]: syslogin_perform_logout: logout() returned an error
Jun  6 21:05:40 node1 sshd[5397]: fatal: openpty returns device for which ttyname fails.               <- but why can not get one tty shell ?
Jun  6 21:05:40 node1 sshd[5397]: error: chown  0 0 failed: No such file or directory
Jun  6 21:05:40 node1 sshd[5397]: error: chmod  0666 failed: No such file or directory

ls -l /users/dev/
total 0
srw-rw-rw- 1 terry root      0 Jun  7 04:56 log
crw-rw-rw- 1 terry root  1,  3 Jun  7 04:04 null
crw-rw-rw- 1 terry root  5,  2 Jun  7 04:58 ptmx
drwxrwxrwx 2 terry terry     0 Jun  7 04:55 pts
crw-rw-rw- 1 terry root  5,  0 Jun  7 04:31 tty
crw-r--r-- 1 terry root  1,  9 Jun  7 04:31 urandom
crw-rw-rw- 1 terry root  1, 12 Jun  7 04:31 zero

ls -l /user/dev/pts  <- empty 

mount
devpts on /users/dev/pts type devpts (rw,uid=500,gid=5,mode=666)


but use command " ssh  terry at 192.168.20.11 bash -i "  I can log into system . .but something wrong , scp command means  unknow user 500. 

please give me advances.

thank you very much.


Best Regards

Terry Tsang.


More information about the openssh-unix-dev mailing list