更进一步于此邮政,我发现如果权限other
应该是---
,那么我可以使用(它似乎有效):
setfacl -R -m d:o::0 test
但使用 SSHFS 时,权限不会保留。 UID 和GID 都被保留。我需要一个解决方案来处理 SSHFS 情况。
答案1
在调用 sshfs 时,您可以使用选项 : -o umask=0007
: 来确保其他选项的“rwx”位全部未设置。
The defaults rights (not mask!) are:
octal: 0755 for a directory
0644 for files
binary: 000 111 101 101 for a directory
000 110 100 100 for a file
ie: --- rwx r-x r-x for a directory
--- rw- r-- r-- for a file
(note: the first octal digit is for: 'setuid', 'setgid', and 'sticky' bits)
The umask will MASK some of those bits.
umask 0007: 000 000 000 111
the original bits are ANDed one by one with the corresponding bit in the mask:
| bitA | bitB | bitA AND bitB |
| 0 | 0 | 0 |
| 0 | 1 | 0 |
| 1 | 0 | 0 |
| 1 | 1 | 1 |
So with umask 0027, the defaults rights shown above will result in:
binary: 000 111 101 000 for a directory
000 110 100 000 for a file
ie: --- rwx r-x --- for a directory
--- rw- r-- --- for a file