I wonder - why, when some folder has read
or read-write
permissions for GROUP
(or other
), the members of the GROUP
(or other
) can't access this folder?
I'm almost sure there is a logical explanation, but I can't find it. Let me give an example.
Initial circumstances
1. There are two users, called admin
and guest
.
2. There is a folder, called /var/www/test-dir
:
$ getfacl -pt /var/www/test-dir/
# file: /var/www/test-dir/
USER root rwx
GROUP admin r-x
other r-x
3. Within these permissions all users are able to access the folder:
USER root rwx (7)
is able to access the folder.GROUP admin r-x (5)
is able to access the folder.other guest r-x (5)
is able to access the folder.guest@host:~$ cd /var/www/test-dir/ guest@host:/var/www/test-dir$
Cases
Case 1: other
has r--
permissions but admin
can't access the folder:
root@host:~# chmod 574 /var/www/test-dir/
USER root r-x (5)
is able to access the folder.GROUP admin rwx (7)
is able to access the folder.other guest r-- (4)
is unable to access the folder.guest@host:~$ cd /var/www/test-dir bash: cd: /var/www/test-dir/: Permission denied
Case 2: other
has rw-
permissions but guest
can't access the folder:
root@host:~# chmod 656 /var/www/test-dir/
USER root rw- (6)
is able to access the folder.GROUP admin r-x (5)
is able to access the folder.other guest rw- (6)
is unable to access the folder:
Case 3: GROUP
has r--
permissions but admin
can't access the folder:
root@host:~# chmod 745 /var/www/test-dir/
USER root rwx (7)
is able to access the folder.GROUP admin r-- (4)
is unable to access the folder.other guest r-x (5)
is able to access the folder.
Case 4: GROUP
has rw-
permissions but admin
can't access the folder:
root@host:~# chmod 467 /var/www/test-dir/
USER root r-- (4)
is able to access the folder.GROUP admin rw- (6)
is unable to access the folder.other guest rwx (7)
is able to access the folder.