[beyes@groad.net tmp]$ mkdir beyes_dir
[beyes@groad.net tmp]$ ls -ld beyes_dir/
drwxrwxr-x. 2 beyes beyes 4096 Mar 10 11:07 beyes_dir/
[beyes@groad.net tmp]$ setfacl -m d:u:sky:rwx beyes_dir/
[beyes@groad.net tmp]$ setfacl -m d:u:sky:rwx,u:sky:rwx beyes_dir/
[beyes@groad.net tmp]$ getfacl --omit-header beyes_dir/
user::rwx
group::rwx
other::r-x
default:user::rwx
default:user:sky:rwx
default:group::rwx
default:mask::rwx
default:other::r-x
[beyes@groad.net tmp]$ chmod u+w beyes_dir/
[beyes@groad.net tmp]$ chmod u-x beyes_dir/
[beyes@groad.net tmp]$ setfacl -m d:u:sky:rwx,u:sky:rwx beyes_dir/
[beyes@groad.net tmp]$ getfacl beyes_dir/
# file: beyes_dir/
# owner: beyes
# group: beyes
user::rw-
user:sky:rwx
group::r-x
mask::rwx
other::r-x
default:user::rw-
default:user:sky:rwx
default:group::r-x
default:mask::rwx
default:other::r-x
[beyes@groad.net tmp]$ chmod u-w beyes_dir/
[beyes@groad.net tmp]$ getfacl beyes_dir/
# file: beyes_dir/
# owner: beyes
# group: beyes
user::r--
user:sky:rwx
group::r-x
mask::rwx
other::r-x
default:user::rw-default:user:sky:rwx #没有改变
default:group::r-x
default:mask::rwx
default:other::r-x
[beyes@groad.net beyes_dir]$ touch 1.txt
[beyes@groad.net beyes_dir]$ ls -l 1.txt
-rw-rw-r--+ 1 beyes beyes 0 Mar 10 14:18 1.txt
[beyes@groad.net beyes_dir]$ getfacl --omit-header 1.txt
user::rw-
user:sky:rwx #effective:rw-
group::rwx #effective:rw-
mask::rw-
other::r--
[beyes@groad.net beyes_dir]$ chmod g-w 1.txt
[beyes@groad.net beyes_dir]$ getfacl 1.txt
# file: 1.txt
# owner: beyes
# group: beyes
user::rw-
user:sky:rwx #effective:r--
group::rwx #effective:r--
mask::r--
other::r--
#=========================注意掩码发生了变化,再改变一次===============================
[beyes@groad.net beyes_dir]$ chmod g+x 1.txt
[beyes@groad.net beyes_dir]$ getfacl 1.txt
# file: 1.txt
# owner: beyes
# group: beyes
user::rw-
user:sky:rwx #effective:r-x
group::rwx #effective:r-x
mask::r-x
other::r--
[beyes@groad.net beyes_dir]$ chmod u-w 1.txt
[beyes@groad.net beyes_dir]$ getfacl 1.txt
# file: 1.txt
# owner: beyes
# group: beyes
user::r--
user:sky:rwx #effective:r-x
group::rwx #effective:r-x
mask::r-x
other::r--
[beyes@groad.net tmp]$ rm -rf beyes_dir/
[beyes@groad.net tmp]$ mkdir beyes_dir
[beyes@groad.net tmp]$ chmod g-rx beyes_dir/
[beyes@groad.net tmp]$ setfacl -m d:u:sky:rwx,u:sky:rwx beyes_dir/
[beyes@groad.net tmp]$ getfacl beyes_dir/
# file: beyes_dir/
# owner: beyes
# group: beyes
user::rwx
user:sky:rwx
group::-w-
mask::rwx
other::r-x
default:user::rwx
default:user:sky:rwx
default:group::-w-
default:mask::rwx
default:other::r-x
[beyes@groad.net tmp]$ touch beyes_dir/1.txt
[beyes@groad.net tmp]$ getfacl beyes_dir/1.txt
# file: beyes_dir/1.txt
# owner: beyes
# group: beyes
user::rw-
user:sky:rwx #effective:rw-
group::-w-
mask::rw-
other::r--
[beyes@groad.net tmp]$ rm -rf beyes_dir/
[beyes@groad.net tmp]$ mkdir beyes_dir
[beyes@groad.net tmp]$ setfacl -m d:g:corp:rwx,g:corp:rwx beyes_dir/
[beyes@groad.net tmp]$ getfacl beyes_dir/
# file: beyes_dir/
# owner: beyes
# group: beyes
user::rwx
group::rwx
group:corp:rwx
mask::rwx
other::r-x
default:user::rwx
default:group::rwx
default:group:corp:rwx
default:mask::rwx
default:other::r-x
[sky@groad.net beyes_dir]$ chmod 000 1.txt
[sky@groad.net beyes_dir]$ ll 1.txt
----------+ 1 sky corp 0 Mar 11 13:16 1.txt
[sky@groad.net beyes_dir]$ getfacl 1.txt
# file: 1.txt
# owner: sky
# group: corp
user::---
group::rwx #effective:---
group:corp:rwx #effective:---
mask::---
other::---
[gilble@groad.net beyes_dir]$ rm 1.txt
rm: remove write-protected regular empty file `1.txt'? y
[gilble@groad.net beyes_dir]$ ll
total 0
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |