Не может CD в мой собственный каталог?

На экземпляре EC2 я изменил местоположение журнала Apache к другому каталогу, чем значение по умолчанию. Это - то, так, чтобы я мог держать вход в систему (неначальная загрузка, только данные) EBS.

Однако я не могу cd в каталог журналов. Это принадлежит моему пользователю и прочитало полномочия для всех. Я не могу cat журналы любой (хотя с sudo это работает и я вижу, что Apache регистрируется очень хорошо).

$ ls -lh
total 4.0K
drw-rw-rw- 2 ubuntu ubuntu 4.0K 2011-05-15 14:52 apache
$ ls -lh apache/
ls: cannot access apache/error.log: Permission denied
ls: cannot access apache/access.log: Permission denied
total 0
-????????? ? ? ? ?                ? access.log
-????????? ? ? ? ?                ? error.log
$ cd apache
-bash: cd: apache: Permission denied
$ sudo ls -lh apache/
total 2.4M
-rw-r--r-- 1 ubuntu ubuntu 2.4M 2011-05-15 15:04 access.log
-rw-r--r-- 1 ubuntu ubuntu  27K 2011-05-15 15:00 error.log

Это не имеет никакого смысла мне.Помощь?

Править: файловая система является ext4.

10
задан 15.05.2011, 18:05

0 ответов

Вам нужен выполнить набор битов на каталогах, если Вы хотите смочь переключиться на это. (Тип файловой системы действительно не имеет значения.)

chmod u+x ./apache
13
ответ дан 07.12.2019, 12:42

В http://www.albany.edu/faculty/gms/homepage101/unix_permissions.html говорится

ТАБЛИЦА 1. Полномочия КАТАЛОГА UNIX

WHO                     WHAT THE PERMISSIONS ALLOW
USER   Read (r)         The account owner can list the files in the directory.
       Write (w)        The account owner can create or delete files in the 
                        directory.
       Execute (x)      access files in that directory by name (such as Web 
                        page files).

GROUP  Read (r)         Everyone in the designated group can list the files in 
                        the directory.
       Write (w)        Everyone in the group can create or delete files in the 
                        directory.
       Execute (x)      Everyone in the group can change (cd) into the 
                        directory and access files in that directory by name 
                        (such as Web page files).

OTHER  Read (r)         Anyone can list the files in the directory.
       Write (w)        Anyone can create or delete files in the directory.
       Execute (x)      Anyone can change (cd) into the directory and access 
                        files in that directory by name 
                        (such as Web page files).

Статью Wikipedia стоит прочитать и говорит

Эффект установки полномочий на каталоге (а не файл) является "одной из наиболее часто недооцененных проблем разрешения файла" (Hatch 2003).

7
ответ дан 07.12.2019, 12:42

Теги

Похожие вопросы