lshell來限制一個使用者的shell和切換目錄和,命令
阿新 • • 發佈:2018-11-30
原始碼地址:https://github.com/ghantoos/lshell
部署:python setup.py install –no-compile –install-scripts=/usr/bin/
配置檔案:/etc/lshell.conf
[email protected]:~# cat /etc/lshell.conf|grep -vE '^$|^#'
[global]
logpath : /var/log/lshell/
loglevel : 2
path : ['/root','/home/hanye','/usr','/data','/mnt']
[default]
allowed : ['ls', 'echo','ll','grep','chmod','ip','ifconfig','ss']
forbidden : [';', '&', '|','`','>','<', '$(', '${']
warning_counter : 2
aliases : {'ll':'ls -l'}
strict : 0
看出 只能執行:['ls', 'echo','ll','grep','chmod','ip','ifconfig','ss']
切換目錄:['/root','/home/hanye','/usr','/data','/mnt']
指定使用者使用次shell:chsh -s /usr/local/bin/lshell hanye
登陸檢視