我正在尝试为特定文件设置 ACL,但使用选项
- R 代表递归
- d 为默认值
- m 用于修改
似乎没有任何效果,如下所示:
/home/pkaramol/Desktop/somedir
$ getfacl afile
# file: afile
# owner: pkaramol
# group: pkaramol
user::rw-
group::rw-
other::---
/home/pkaramol/Desktop/somedir
$ sudo setfacl -Rdm u:bullwinkle:rwx afile
/home/pkaramol/Desktop/somedir
$ getfacl afile
# file: afile
# owner: pkaramol
# group: pkaramol
user::rw-
group::rw-
other::---
答案1
-Rd
只有在处理目录时,使用real 才有意义。要修改给定文件的 ACL 并添加另一个用户,您只需执行以下操作:
$ sudo setfacl -m u:user1:rwx somefile
$ getfacl somefile
# file: somefile
# owner: root
# group: root
user::rw-
user:user1:rwx
group::r--
mask::rwx
other::r--
每页man setfacl
:
-R, --recursive
Apply operations to all files and directories recursively. This
option cannot be mixed with `--restore'.
-d, --default
All operations apply to the Default ACL. Regular ACL entries in the
input set are promoted to Default ACL entries. Default ACL entries in
the input set are discarded. (A warning is issued if that
happens).