Originally posted by: SystemAdmin
I follow the KB from IBM website to setup chroot environment to limit users to access their home directory.
http://www-01.ibm.com/support/docview.wss?uid=isg3T1012883 I create /home/chroot for chroot environment.
The path home directory for chroot user account "user1" is:
/home/chroot/home/user1
The entry for chroot use account "user1" in /etc/passwd is as below:
user1:!:210:205:chroot user:/home/chroot/home/user1:/usr/bin/ksh
The entry for chroot use account "user1" in /home/chroot/etc/passwd is as below:
user1:!:210:205:chroot user:/home/user1:/usr/bin/ksh
The content of /etc/ssh/sshd_config
Match User user1
ChrootDirectory /home/chroot
When I tried to login AIX through SSH but failed to login even the password is correct and the connection closed immediately.
I turned on SSH debug. Some errors are as follow:
debug3: AIX/setauthdb set registry 'files'
debug3: aix_restoreauthdb: restoring old registry ''
debug3: AIX/setauthdb set registry 'files'
debug3: aix_restoreauthdb: restoring old registry ''
debug1: TMP*****************:/home/chroot
debug1: CHROOT_PATH*********:/home/chroot
debug1: pw->pw_name:acedlusr::pw->pw_dir:/home/chroot/./home/user1
debug3: safely_chroot: checking '/'
debug3: safely_chroot: checking '/home/'
debug3: safely_chroot: checking '/home/chroot'
chroot("/home/chroot"): Operation not permitted.
debug1: do_cleanup
Do anyone what the meaning of "chroot("/home/chroot"): Operation not permitted." ?
Also, I found some article mention that setup home directory for chroot user account as follow:
For exmaple for creating user account:
The entry for chroot use account "user1" in /etc/passwd is as below:
user1:!:210:205:chroot user:/home/chroot/./home/user1:/usr/bin/ksh
Are Both /home/chroot/home/user1 and /home/chroot/./home/user1 same?
Also, another article mention the content of /etc/passwd and /home/chroot/etc/passwd are the same.
user1:!:210:205:chroot user:/home/chroot/home/user1:/usr/bin/ksh
But according to the KB, the content of /etc/passwd and /home/chroot/etc/passwd are different.
http://www-01.ibm.com/support/docview.wss?uid=isg3T1012883 The content of /etc/passwd:
user1:!:210:205:chroot user:/home/chroot/home/user1:/usr/bin/ksh
The content of /home/chroot/etc/passwd:
user1:!:210:205:chroot user:/home/user1:/usr/bin/ksh
Which setting is correct?
Also, are there any minimum requirement for chroot? OS version (AIX 5.3 and AI 6.3)? SSH version?
#AIX-Forum