项目背景
在做Linux服务器管理时候由于有些生产环境上的信息,或者一些其他敏感的配置信息不让ftp或者普通用户访问,以达到信息安全和隐秘的要求
项目环境操作系统 :centos7.2
涉及的命令:yum 、setfacl(访问控制权限)
安装ACLyum -y install acl查看ACL是否安装成功
rpm -qa | grep aclsetfacl命令的用法
setfacl 2.2.51 -- set file access control lists Usage: setfacl [-bkndRLP] { -m|-M|-x|-X ... } file ... -m, --modify=acl modify the current ACL(s) of file(s) -M, --modify-file=file read ACL entries to modify from file -x, --remove=acl remove entries from the ACL(s) of file(s) -X, --remove-file=file read ACL entries to remove from file -b, --remove-all remove all extended ACL entries -k, --remove-default remove the default ACL --set=acl set the ACL of file(s), replacing the current ACL --set-file=file read ACL entries to set from file --mask do recalculate the effective rights mask -n, --no-mask don"t recalculate the effective rights mask -d, --default operations apply to the default ACL -R, --recursive recurse into subdirectories -L, --logical logical walk, follow symbolic links -P, --physical physical walk, do not follow symbolic links --restore=file restore ACLs (inverse of `getfacl -R") --test test mode (ACLs are not modified) -v, --version print version and exit -h, --help this help text设置用户的访问权限
比如在服务器上希望普通用户ubuntu不能访问 /etc 、/usr等系统配置目录 , 则配置如下
setfacl -R -m u:ubuntu:- /etc /usr
-R表示递归,-m表示修改,u:ubuntu:-表示用户(user)ubuntu对/etc 和 /usr 没有任何权限。可以根据需要添加r、w、x及其组合。
取消用户的访问限制setfacl -R -x u:ubuntu /etc /usr
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/10038.html
摘要:传送门中级内容包括工具函数中断及时间处理等进阶主题。反斜杠用于禁用别名扩展功能。删除所有的别名,可以消除隐患。敏感信息哈希表当前运行环境下,执行过的命令会被添加到哈希表,用于提高再次调用时的访问速度。更改权限用于修改目录及文件权限。 showImg(https://segmentfault.com/img/bVZARf?w=314&h=413); Read Me 本文是以英文版 为基...
摘要:传送门中级内容包括工具函数中断及时间处理等进阶主题。反斜杠用于禁用别名扩展功能。删除所有的别名,可以消除隐患。敏感信息哈希表当前运行环境下,执行过的命令会被添加到哈希表,用于提高再次调用时的访问速度。更改权限用于修改目录及文件权限。 showImg(https://segmentfault.com/img/bVZARf?w=314&h=413); Read Me 本文是以英文版 为基...
摘要:传送门中级内容包括工具函数中断及时间处理等进阶主题。反斜杠用于禁用别名扩展功能。删除所有的别名,可以消除隐患。敏感信息哈希表当前运行环境下,执行过的命令会被添加到哈希表,用于提高再次调用时的访问速度。更改权限用于修改目录及文件权限。 showImg(https://segmentfault.com/img/bVZARf?w=314&h=413); Read Me 本文是以英文版 为基...
阅读 1742·2023-04-25 15:45
阅读 879·2021-09-29 09:34
阅读 2377·2021-09-03 10:30
阅读 1776·2019-08-30 15:56
阅读 1341·2019-08-29 15:31
阅读 1145·2019-08-29 15:29
阅读 3064·2019-08-29 11:24
阅读 3047·2019-08-28 17:46