I have just run into the case in which the owner-group of a file has more permissions than the owner-user of a file.
user1@pc:/tmp$ ls testfile -l
----rw---- 1 user1 user1 9 Okt 16 13:16 testfile
Since the user user1
has no permissions to to read the file I get this
user1@pc:/tmp$ cat testfile
cat: testfile: Permission denied
This suprised me as user1
is member of the group user1
which has permission to read the file.
Interesstingly when doing this:
root@pc:/tmp$ addgroup user2 user1
Adding user `test' to group `ress' ...
Adding user test to group ress
Done.
root@pc:/tmp$ su user2
user2@pc:/tmp$ cat testfile
content of testfile
user2@pc:/tmp$
I can read testfile
's content.
It seesms the permissions granded (or not) on the user-owner level take precedence over anything later like the permissions existing due to group membership.
My question is if there is a reference to this behaviour I experience in my linux system (that is that not having user-permissions takes away group-permissions)
Also is there a use case for this behaviour?