1.查看是否启用ACL功能(例如sdb1)
# tune2fs -l /dev/sdb1 | grep acl
2.启用ACL功能
# vi /etc/fstab
LABEL=sdb1 /mnt/sdb1 ext3 defaults,acl
3.重新挂载分区
# mount -o remount,acl /mnt/sdb1
4.验证ACL功能是否启用
# mount
/dev/sdb1 on /mnt/sdb1 type ext3 (rw,acl)
5.创建文件
# touch test
6.设置访问控制权限
[root@redhat ~]# getfacl file
# file:file
# owner:root
# group:root
user::rw-
group::r--
other::r--
[root@redhat ~]# setfacl -m u:user1:rw file
[root@redhat ~]# getfacl file
# file:file
# owner:root
# group:root
user::rw-
user:user1:rw-
group::r--
other::r--
[root@redhat ~]# setfacl -m g:user1:rw file
[root@redhat ~]# getfacl file
# file:file
# owner:root
# group:root
user::rw-
user:user1:rw-
group::r--
group:user1:rw-
other::r--
[root@redhat ~]# setfacl -b file
[root@redhat ~]# getfacl file
# file:file
# owner:root
# group:root
user::rw-
group::r--
other::r--
阅读(570) | 评论(0) | 转发(0) |