Jailkit Chroot
下载:
http://olivier.sessink.nl/jailkit/index.html#download
wget http://olivier.sessink.nl/jailkit/jailkit-2.16.tar.gz
tar xvf jailkit-2.16.tar.gz
cd jailkit-2.16
./configure
make
make install
cp extra/jailkit /etc/init.d/jailkit
chmod a+x /etc/init.d/jailkit
chkconfig jailkit on (Centos)
update-rc.d -f jailkit defaults (debian/ubuntu)
mkdir /jail
chown root:root /jail
给用户创建适当方案:
jk_init -v /jail basicshell
jk_init -v -j /jail jk_lsh
jk_init -v /jail editors
jk_init -v /jail extendedshell
jk_init -v /jail netutils
jk_init -v /jail ssh
jk_init -v /jail sftp
新建用户
adduser lyp
jk_jailuser -m -j /jail lyp
mkdir -p /jail/home/lyp
chown lyp:lyp /home/lyp
允许用户shell
vi /jail/etc/passwd
lyp:x:1001:1000::/home/thomas:/bin/bash