SSHFSの場合、ディレクトリとファイルは親ディレクトリと同じ権限を継承できますか?

SSHFSの場合、ディレクトリとファイルは親ディレクトリと同じ権限を継承できますか?

さらに一歩進む郵便はがき、権限がotherなければ---以下が使用できることがわかりました(動作するようです)。

setfacl -R -m d:o::0 test

ただし、SSHFSを使用しても権限は保持されません。 UIDとGIDの両方が保存されます。 SSHFS状況を処理するためのソリューションが必要です。

ベストアンサー1

sshfsを呼び出すときは、options::-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

おすすめ記事