I'm a bit confused by the permissions on a file.
Just to experiment, I tried the following as user "jorre"
chown jorre:jorre file.txt
chmod 040 file.txt
I would expect this file to be readable by user "jorre" since that user exists in the group "jorre". However, I'm getting permissions errors when trying to read the file.
Is that because I'm the owner of the file and group permissions are ignore because of that? I am in the group so I would have thought that group permissions would be valid in this case as well.
Thanks for clarifying this!
This is because you the user
jorre
, is the owner of the file.The file permissions specifically do not allow read, write or execute of that file to the owner (
jorre
).If you were to change the owner to another user, then you would be able to read the file under the group permissions.
Excert from File system permissions wiki page