ACL:访问控制了列表
ACL:Access Control List(针对文件或目录的访问控制列表),相当于一个补充
- 可以针对用户来设置权限
- 可以针对用户组来设置权限
- 子文件/目录继承父目录的权限
setfacl:设置ACL
-m :配置后面的ACL参数
-x :删除ACL参数
-b :删除所有ACL配置参数
-k :移除默认的ACL参数
-R :递归配置ACL
-d :配置‘默认的ACL参数’,只对目录有效,在该目录新建数据会引用此值
getfacl :查看当前ACL权限
示例:
对目录: 注:u换成g就可以修改属组权限了
[root@localhost ~]# useradd test
[root@localhost ~]# cd /tmp/
[root@localhost /tmp]# mkdir testacl
[root@localhost tmp]# ll -d testacl/
drwxr-xr-x+ 3 root root 18 May 14 17:19 testacl/
[root@localhost tmp]# getfacl testacl/
# file: testacl/
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
[root@localhost tmp]# su - test
[test@localhost ~]$ cd /tmp/
[test@localhost tmp]$ cd testacl/
[test@localhost testacl]$ touch file
touch: cannot touch
本文介绍了Linux系统中的ACL(访问控制列表)和umask(权限掩码)的概念。ACL允许对文件和目录进行更精细的权限设置,支持针对用户和用户组设定权限,并能实现子文件/目录继承父目录的权限。setfacl和getfacl命令分别用于设置和查看ACL权限。而umask则是控制创建文件和目录时默认权限的一个机制,它定义了系统在创建新文件时会从默认权限中移除哪些权限。
最低0.47元/天 解锁文章
633

被折叠的 条评论
为什么被折叠?



