0

Good time of day, my dear friends. I've got a user "http" with group "http", a dir "drupal-8.8.5" inside /home/yasuostormrage with 777 permissions for yasuostormrage:http, but there's a problem: user http cannot access this dir. Why user "http" cannot access this dir and how to make this dir accessible by user "http" (and group "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

EDIT 1
/home is already 750 /home/yasuostormrage was 700, so i changed it to 770

mama-pc 明日は明日の風が吹く /home
あす ls -l /home | grep "yasuostormrage"
drwxrwx--- 16 yasuostormrage http 4096 мая 18 12:36 yasuostormrage
2
  • With rwxrwxrwx the group does not matter. Should probably be 770. I guess the user does not get that far. What are the permissions for /home/yasuostormrage? – Hauke Laging May 18 '20 at 9:34
  • Can you please add output for namei -l /home/yasuostormrage/drupal-8.8.5/core/install.php? It might be the case, that http doesn't have permission for /home or core inside drupal. PS. Some of us are not able to read Russian :) It'd be nice to replace Russian errors with English text (e.g. export LANG=C and re-run commands) – rush May 18 '20 at 9:39
0

In order to access a file or directory not only the respective permission on the file is required

  • read for
    • reading the file or
    • showing the names of the files in a directory
  • write for
    • writing the file
    • creating, renaming, or deleting a file in a directory
  • execute for
    • executing a binary
    • changing into a directory or
    • showing the metadata (type, permissions) of the files in a directory
  • read and execute for
    • directly executing a script (/path/to/script instead of bash /path/to/script)

Independent of the file's permissions all parent directories must have execute permission. Read permission is not required (if the full path of the file to be accessed is known).

In this case the directory /home/yasuostormrage with the group http must have one of these permissions:

  • drwxrwx???
  • drwxr-x???
  • drwx--x???
  • drwx-wx??? (unusual)

Permissions marked with ? do not matter.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.