My question is concerning generic troubleshooting when getting 'permission denied' errors while accessing files as certain user and here is a specific example where I could use some extra help:
As a user 'builder' I have a folder 'repo' in my home dir that belongs to group 'builders'. It currently reads as follows:
$ pwd
/home/builder/repo
$ ls -la
total 4
drwxr-sr-x 2 builder builders 20 Jun 9 02:28 .
drwxr--r-- 4 builder builder 123 Jun 7 23:36 ..
-rw-rw-r-- 1 builder builders 5 Jun 9 02:18 status
So, I can see that everyone who is in the 'builders' group should be able to access that 'status' file. It should be noted, that as 'builder' user I can read it, file is not corrupted and readable, i.e. cat /home/builder/repo/status
returns its contents.
However, for some reason I can't access it as another user - 'ec2-user' who happens to be in the builders group:
$ whoami
ec2-user
$ groups
ec2-user adm wheel systemd-journal docker builders
$ ls -la /home/builder/repo/status
ls: cannot access /home/builder/repo/status: Permission denied
$ cat /home/builder/repo/status
cat: /home/builder/repo/status: Permission denied
I'm obviously missing something, but I'm still stuck trying to answer why user belonging to the same group can't access that file. Is there something else that can tell me what I need to do (e.g. as superuser or owner) to properly grant group access permission to a dir/file - or just find out why read permissions not working for some user? The only answer I found for myself is just carefully inspecting ownership info and access control bits, but in the example above everything looks good.