1、挂载文件系统
- [root@stu14 data]# mount –o remount,acl /dev/md1 /data
- [root@stu14 data]# tune2fs –o acl /dev/md1
- [root@stu14 data]# vim /etc/fstab
- /dev/md1 /data ext3 defaults,acl 0 0
2、设定ACL
- # getfacl FIlENAME
- [root@stu14 data]# getfacl test
- # file: test
- # owner: root
- # group: magedu
- user::rw-
- group::r--
- other::r--
- #setfacl <mx> <u:username:mode|g:groupname> FILE
- [root@stu14 data]# setfacl -m u:gentoo:rw- test
- [root@stu14 data]# getfacl test
- # file: test
- # owner: root
- # group: magedu
- user::rw-
- user:gentoo:rw-
- group::r--
- mask::rw-
- other::r--
- [root@stu14 data]# setfacl -x u:gentoo test
- [root@stu14 data]# getfacl test
- # file: test
- # owner: root
- # group: magedu
- user::rw-
- group::r--
- mask::r--
- other::r--
3、设置默认acl
- [root@stu14 data]# setfacl –m d:u:gentoo:rw- test1/
- [root@stu14 data]# setfacl –m d:u:gentoo:rw- test1/
4、递归设置acl
- [root@stu14 data]# setfacl –R –m u:gentoo:rw- test1/
5、权限的生效次序
- [root@stu14 data]# setfacl -m u:gentoo:rw- test
- [root@stu14 data]# setfacl -m g:centos:rw- test
- [root@stu14 data]# getfacl test
- # file: test
- # owner: root
- # group: magedu
- user::rw-
- user:gentoo:rw-
- group::r--
- group:centos:rw-
- mask::rw-
- other::r--