安装jailkit
cd /tmp
wget http://olivier.sessink.nl/jailkit/jailkit-2.16.tar.gz
tar xzf jailkit-2.16.tar.gz
cd jailkit-2.16
./configure
make
make install
cp extra/jailkit /etc/init.d/jailkit
chmod u+x /etc/init.d/jailkit
chkconfig jailkit on
初始化chroot环境
jk_init -v -j /home/chroot sftp scp jk_lsh netutils extendedshell
service jailkit start
新建www.centos.bz用户
useradd foreign -m
echo "test123" | passwd --stdin foreign
chroot用户
jk_jailuser -m -n -j /home/chroot --shell=/bin/bash foreign