Jailkit监牢软件

官网:https://olivier.sessink.nl/jailkit/

安装部署

# yum install -y gcc
# wget https://olivier.sessink.nl/jailkit/jailkit-2.19.tar.gz
# tar xf jailkit-2.19.tar.gz
# cd jailkit-2.19/
# ./configure
# make && make install 

创建监牢目录

# mkdir -p /home/jailkit
# cd /home/jailkit/
# jk_init -v /home/jailkit/ jk_lsh basicshell extendedshell

创建用户,并将用户丢进监牢

# useradd test
# passwd test
# jk_jailuser -j /home/jailkit/ -s /bin/bash test
home directory /home/test is not within /home/jailkit/, move the directory contents?
[Y]/[n]y