ACL生效顺序:
全部者,自定义用户,所属组|自定义组,其余人mysql
[root@centos7 dir3]# getfacl a # file: a # owner: root # group: root user::rw- user:docker1:--- group::r-- mask::r-- other::r-- [root@centos7 dir3]# setfacl -m g:admins:5 a [root@centos7 dir3]# getfacl a # file: a # owner: root # group: root user::rw- user:docker1:--- group::r-- group:admins:r-x mask::r-x other::r--
setfacl -b a
#清除全部ACL权限getfacl file1 | setfacl --set-file=-file2
#复制file1的acl权限给file2web
mask 权限sql
[root@centos7 dir3]# setfacl -m mask::rx a [root@centos7 dir3]# getfacl a # file: a # owner: root # group: root user::rw- user:docker1:--- group::r-- group:admins:r-x mask::r-x other::r--
--set选项会把原有的ACL项都删除,用新的替代,须要注意的是必定要包含UGO的设置,不能象-m同样 只是添加ACL就能够setfacl --set u::rw,u:wang:rw,g::r,o::- file1
docker
#备份ACL getfacl -R /tmp/dir > acl.txt
#消除ACL权限 setfacl -R -b /tmp/dir
#还原ACL权限 setfacl -R --set-file=acl.txt
#还原ACL权限 setfacl --restore acl.txt
#查看ACL权限 getfacl -R /tmp/dircentos
[root@centos7 ~]# mkdir -p /testdir/dir [root@centos7 ~]# groupadd webs [root@centos7 ~]# chgrp webs /testdir/dir [root@centos7 ~]# chmod g+s /testdir/dir [root@centos7 ~]# groupadd apps;groupadd dbs [root@centos7 ~]# useradd -G apps tomcat;useradd -G dbs mysql [root@centos7 ~]# setfacl -d -m g:apps:rw /testdir/dir [root@centos7 ~]# setfacl -d -m g:dbs:r /testdir/dir [root@centos7 ~]# chmod o= /testdir/dir
install /usr/bin/chmod -m 744 /chmod #在用install指令拷贝时指定权限,趁此时假如执行权限 mv /chmod /usr/bin/chmod mv:是否覆盖"/usr/bin/chmod"? y #用mv命令将先前的chmod覆盖 ll /usr/bin/chmod -rwxr--r--. 1 root root 58584 3月 16 16:39 /usr/bin/chmod