分类: LINUX
2010-05-20 17:24:27
# ls -l [leonard@localhost ~]$ ls -l -rw-rw---- 1 leonard admin 0 Jul 3 20:12 test.txt
# rpm -ivh libacl-2.2.39-1.1 acl-2.2.39-1.1.i386.rpm
[leonard@localhost ~]$ getfacl ./test.txt # file: test.txt # owner: leonard # group: admin user::rw- user:john:rw- group::rw- group:dev:r-- mask::rw- other::r--
[leonard@localhost ~]$ ls -l -rw-rw-r-- 1 leonard admin 0 Jul 3 22:06 test.txt [leonard@localhost ~]$ getfacl --omit-header ./test.txt user::rw- group::rw- other::r--
[leonard@localhost ~]$ setfacl -m user:john:rw- ./test.txt [leonard@localhost ~]$ getfacl --omit-header ./test.txt user::rw- user:john:rw- group::rw- mask::rw- other::r--
[leonard@localhost ~]$ ls -l ./test.txt -rw-rw-r--+ 1 leonard admin 0 Jul 3 22:06 ./test.txt
[leonard@localhost ~]$ setfacl -m group:dev:r-- ./test.txt [leonard@localhost ~]$ getfacl --omit-header ./test.txt user::rw- user:john:rw- group::rw- group:dev:r-- mask::rw- other::r--
[leonard@localhost ~]$ ls -l -rwxrw-r-- 1 leonard admin 0 Jul 3 23:10 test.sh
[leonard@localhost ~]$ setfacl -m user:john:rwx ./test.sh [leonard@localhost ~]$ getfacl --omit-header ./test.sh user::rwx user:john:rwx group::rw- mask::rwx other::r--
[leonard@localhost ~]$ ls -l -rwxrwxr--+ 1 leonard admin 0 Jul 3 23:10 test.sh
[leonard@localhost ~]$ setfacl -m mask::r-- ./test.sh [leonard@localhost ~]$ getfacl --omit-header ./test.sh user::rwx user:john:rwx #effective:r-- group::rw- #effective:r-- mask::r-- other::r--
[leonard@localhost ~]$ ls -l -rwxr--r--+ 1 leonard admin 0 Jul 3 23:10 test.sh
[leonard@localhost ~]$ mkdir dir
[leonard@localhost ~]$ setfacl -d -m user:john:rw ./dir [leonard@localhost ~]$ getfacl --omit-header ./dir user::rwx group::rwx other::r-x default:user::rwx default:user:john:rwx default:group::rwx default:mask::rwx default: other::r-x
[leonard@localhost ~]$ touch ./dir/test.txt [leonard@localhost ~]$ ls -l ./dir/test.txt -rw-rw-r--+ 1 leonard leonard 0 Jul 3 23:46 ./dir/test.txt [leonard@localhost ~]$ getfacl --omit-header ./dir/test.txt user::rw- user:john:rw- group::rwx #effective:rw- mask::rw- other::r--