setfacl的英文全称是“ set file access control list ”,即“设置文件访问控制列表”。改命令可以更精确的控制权限的分配,比如让某一个用户对某一个文件具有某种权限。
ACL指文件的所有者、所属组、其他人的读/写/执行之外的特殊的权限, 对于需要特殊权限的使用状况有一定帮助。 如,某一个文件,不让单一的某个用户访问。
语法格式:setfacl [参数] [文件]
常用参数:
参考实例
修改一个文件的acl权限,添加一个用户权限:
[root@linuxcool ~]# getfacl test
file: test
owner: root
group: root
user::rwx
user:zwx:rw-
group::r-x
mask::rwx
other::r-x
[root@linuxcool ~]# setfacl -Rm u:zwx:rw- test
[root@linuxcool ~]# getfacl test
file: test
owner: root
group: root
user::rwx
user:zwx:rw-
group::r-x
mask::rwx
other::r-x
清除一个目录的ACL权限:
[root@linuxcool ~]# setfacl -x u:zwx test
[root@linuxcool ~]# getfacl test
file: test
owner: root
group: root
user::rwx
group::r-x
other::r-x
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)