I'm aware that there are other similar questions, but nothing in there solved my issue.
gitlab-runner@my-machine:~$ groups
gitlab-runner my-user
gitlab-runner@my-machine:~$ sudo ls -l /home
total 16
drwxrwsr-x+ 16 my-user my-user 4096 Feb 13 09:22 my-user
# ... other users' homes omitted ...
gitlab-runner@my-machine:~$ sudo ls -l /home/my-user
total 528
drwsrws---+ 4 my-user my-user 4096 Jun 7 2020 my-dir
# ... irrelevant files omitted ...
gitlab-runner@my-machine:~$ sudo ls -l /home/my-user/my-dir
total 48
drwxrwsr-x+ 7 my-user my-user 4096 Aug 12 2021 my-dir
drwxrwsr-x+ 6 my-user my-user 4096 Jun 7 2020 venv
gitlab-runner@my-machine:~$ cd /home/my-user/my-dir
-bash: cd: /home/my-user/my-dir: Permission denied
The user is a member of the group, the group has read and execute permissions on the target folder and the home it's contained in, and yet the user cannot cd
into it. I have also tried logout
and then sudo - gitlab-runner
again, but it still doesn't work. Why?
I'm unsure why the x
bit shows s
and I can't find an explanation anywhere. Maybe that's relevant but I don't know what it means nor how to change it, since sudo chmod g+x
doesn't change it.
s
is the SetUID, SetGID, etc. bit. You can read about it in many places, such as this link. As for your problem, why don't you take it a bit at a time?cd
into/home
, then/home/my-user
, etc. Let's see where it gets to. Also, why are you doingsudo - gitlab-runner
? Does that user not have a password that you can log in with?+
sign after permissions field shown for each one of the directories, which means that additional permissions are set using ACLs. These may override the "basic" permissions. Check withsudo getfacl pathname
for each directory. As for thes
bit on group, it means that the files/subdirs created in directory will have group set to directory's group regardless of who creates them. You can remove this withsudo chmod g-s pathname
.su - gitlab-runner
, notsudo
. My bad.