linux控制命令使用限制,【L-shell】Linux 系统下 限制用户的活动目录,控制用户使用命令的权限。...
1、前提:
安裝yum 擴展源:
注:本人用的是CentOS
6.5,64位系統,所以下的是這個地址。(如果是其它版本或其他情況,參考下面的地址:)
centos5
:
32位epel源下載地址:
www.lishiming.net/data/attachment/forum/epel-release-5-4_32.noarch.rpm
64位下載地址:
www.lishiming.net/data/attachment/forum/epel-release-5-4_64.noarch.rpm
centos6
:
32位epel yum源下載地址:
www.lishiming.net/data/attachment/forum/epel-release-6-8_32.noarch.rpm
64位下載地址:
www.lishiming.net/data/attachment/forum/epel-release-6-
8_64.noarch.rpm?
2、yum安裝lshell
lshell.noarch : Python-based limited Shell
yum install -y lshell
3、編輯配置文件
configure file:
/etc/lshell.conf
============================================
aliases
: {'ls':'ls -l', 'cd':'cd /home'}
allowed
:
['grep','cd','cp','sed','ls','pwd']
####允許使用的命令 ###
forbidden
: [';', '&',
'|','`','>','
'${']? ######設置非法字符##
home_path
: '/home/'?? ####設置用戶的家目錄###
path
:
['/home/a/b/]
####限制用戶的目錄####
=============================================
4、對賬號使用:
usermod -s /usr/bin/lshell TEST?
cat /etc/passwd |grep
lsh
TEST:x:59573:59573::/home/TEST:/usr/bin/lshell
與50位技術專家面對面20年技術見證,附贈技術全景圖總結
以上是生活随笔為你收集整理的linux控制命令使用限制,【L-shell】Linux 系统下 限制用户的活动目录,控制用户使用命令的权限。...的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python类百度百科_Python抓取
- 下一篇: python爬去百度百科词条_pytho