Originally posted by: SystemAdmin
Thanks Enrique but that wasn`t it, I already did that. Basically, I had 2 issues:
1- I didn`t have the latest version of SSH installed which contains a patch for chroot
2- I used a script to setup my environment and another to remove everything so every time, I would recreate the user. What happen`s the first time the user logs in, it asks for a password change and for some reason, that just killed the ssh session.
Here`s the info I finally found and used:
New version of openssh-4.5 (openssh-4.5p1-r2 ) has been release by IBM.
You can download it from the following link :
http://sourceforge.net/projects/openssh-aix This release supports chroot.
Setting Up chroot/jailed Environment:
Let us create a directory say /home/chroot so that we can create chroot
environment under this directory. So all the chrooted users get jailed
under this directory i.e. they will not be able to see any files outside
the /home/chroot directory.
You need to create some directories in this /home/chroot directory and
copy important( needed ) binaries like:
mkdir -p /home/chroot/home
cd /home/chroot
mkdir etc
mkdir bin
mkdir lib
mkdir usr
mknod dev/null c 2 2
mknod dev/zero c 2 3
mknod dev/tty c 1 3
Procedure to create chrooted users:
Run the following commands:
useradd -s /bin/ksh -m -d /home/chroot/./home/username/ -c <"> <username>
Assign password to this user
Copy the entry for <username> in the /etc/passwd file to
/home/chroot/etc/passwd file
Also copy the entry for that user in the /etc/groups to
/home/chroot/etc/groups files
P.S : You need to copy all the binaries that you want to run in the new chrooted directory:
eg: say you want to run ls command in the chrooted envirnoment, then do ' ldd on /usr/bin/ls "
copy all the displayed libraries in the corresponding directories of the chroot.
also copy the binary in the corresponding directory along with the proper permissions.
Now you can run the ls command in the chrooted directory.
#AIX-Forum