http://olivier.sessink.nl/jailkit/jailkit-2.0.tar.gztar -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:x: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:x:500:


vi /jail/etc/passwd
paste and save this:
thomas:x:1001:500::/home/thomas:/bin/bash

cp /etc/skel/.bashrc /jail/home/thomas
chown thomas:thomas /jail/home/thomas/.bashrc
ssh thomas@localhost


千万不要死套用,这只是我配置成功的过程,可能某些地方和大家有点差别要灵活运用



  • 12-18 01:25