查看一个文件/文件夹的ACL设置:getfacl filename(文件名).
[root@192 ~]# ll
总用量 4
-rw-------. 1 root root 1256 5月 6 16:12 anaconda-ks.cfg
[root@192 ~]# getfacl anaconda-ks.cfg
# file: anaconda-ks.cfg
# owner: root
# group: root
user::rw-
group::---
other::---
[root@192 ~]#
针对一个用户对文件进行ACL设置。
setfacl -m u:nash_su:rwx anaconda-ks.cfg
针对一个组对文件进行ACL设置:
setfacl -m g:training:rw anaconda-ks.cfg
删除一个ACL设置:
setfacl -x u:nash_su anaconda-ks.cfg
[root@192 ~]# touch aa
[root@192 ~]# ll
总用量 4
-rw-r--r--. 1 root root 0 7月 7 22:10 aa
-rw-------. 1 root root 1256 5月 6 16:12 anaconda-ks.cfg
[root@192 ~]# getfacl aa
# file: aa
# owner: root
# group: root
user::rw-
group::r--
other::r--
[root@192 ~]# setfacl -m u:nash_su:rwx aa
[root@192 ~]# getfacl aa
# file: aa
# owner: root
# group: root
user::rw-
user:nash_su:rwx
group::r--
mask::rwx
other::r--
[root@192 ~]#