tar -zxvf jailkit-2.0.tar.gz
cd jailkit-2.0
./configure
make
make install
mkdir /jail
chown root:root /jail
jk_init -v /jail basicshell
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 thomas
jk_jailuser -m -j /jail thomas
vi /etc/passwd:
thomas:1001:500::/jail/./home/thomas:/usr/sbin/jk_chrootsh
passwd thomas
mkdir -p /jail/home/thomas
chown thomas:thomas /jail/home/thomas
vi /jail/etc/group
paste and save this:
thomas:500:
vi /jail/etc/passwd
paste and save this:
thomas:1001:500::/home/thomas:/bin/bash
cp /etc/skel/.bashrc /jail/home/thomas
chown thomas:thomas /jail/home/thomas/.bashrc
ssh
阅读(1021) | 评论(0) | 转发(0) |