
愛する友人の皆さん、楽しい一日をお過ごしください。ユーザー "http"、グループ "http"があり、 "drupal-8.8.5"ディレクトリは/home/yasuostormrageにあり、yasuostormrage:httpに対して777権限がありますが、問題があります。 httpユーザーはそれにアクセスできません。礼拝の規則。ユーザー「http」がこのディレクトリにアクセスできない理由と、このディレクトリにユーザー「http」(およびグループ「http」)がアクセスできるようにする方法です。
mama-pc 明日は明日の風が吹く ~
あす sudo -u http id
uid=33(http) gid=33(http) группы=33(http)
mama-pc 明日は明日の風が吹く ~
あす ls -l
итого 16
drwxr-xr-x 7 yasuostormrage yasuostormrage 4096 апр 29 23:41 bin
drwxr-xr-x 5 yasuostormrage yasuostormrage 4096 мая 13 06:37 data
drwxrwxrwx 8 yasuostormrage http 4096 апр 3 00:06 drupal-8.8.5
drwxr-xr-x 5 yasuostormrage yasuostormrage 4096 мая 14 09:30 Work
mama-pc 明日は明日の風が吹く ~
あす sudo -u http ls /home/yasuostormrage/drupal-8.8.5
ls: cannot open directory '/home/yasuostormrage/drupal-8.8.5': Permission denied
mama-pc 明日は明日の風が吹く ~
あす ls -l drupal-8.8.5/core | grep install.php
-rwxrwxrwx 1 yasuostormrage http 1598 апр 3 00:06 install.php
mama-pc 明日は明日の風が吹く ~
あす sudo -u http cat /home/yasuostormrage/drupal-8.8.5/core/install.php ⏎
cat: /home/yasuostormrage/drupal-8.8.5/core/install.php: Permission denied
編集1
/homeはすでに750で、/home/yasuostormrageは700だったので770に変更しました。
mama-pc 明日は明日の風が吹く /home
あす ls -l /home | grep "yasuostormrage"
drwxrwx--- 16 yasuostormrage http 4096 мая 18 12:36 yasuostormrage
答え1
ファイルまたはディレクトリにアクセスするには、ファイルに対する適切な権限だけでなく、
- 読む
- ファイルを読むか
- ディレクトリ内のファイル名を表示
- に手紙を書く
- ファイルの書き込み
- ディレクトリからファイルを作成、名前変更、または削除する
- 次のように実行
- バイナリファイルの実行
- ディレクトリに変更するか、
- ディレクトリ内のファイルのメタデータ(タイプ、権限)の表示
- 読み取りと実行
- スクリプトを直接実行(
/path/to/script
代わりにbash /path/to/script
)
- スクリプトを直接実行(
ファイル権限に関係なく、すべての親ディレクトリに実行権限が必要です。読み取り権限は必要ありません(アクセスするファイルのフルパスを知っている場合)。
/home/yasuostormrage
この場合、このグループを含むディレクトリには、次のいずれhttp
かの権限が必要です。
drwxrwx???
drwxr-x???
drwx--x???
drwx-wx???
(以上)
で示される権限は?
重要ではありません。