Friday, November 21, 2014

linux - group permission not working



I'm installing gitlab at my server but I got a permission problem:




I have two users, 'git' and 'gitlab', both are part of group 'git', the home dir of 'git' has the drwxr----- permissions. Therefore 'gitlab' should be able to read it, but I got a permission denied when trying to change dir to 'git' home dir from 'gitlab' user.



Someone has any idea on that?



/home/git and /home/git/repositories:



523265 4 drwxr-----. 7 git  git  4096 Jul  3 06:15 git
523278 4 drwxrwx---. 7 git git 4096 Jul 3 05:12 repositories



'gitlab' groups:



[gitlab@greenboxServer home]$ groups
gitlab git
[gitlab@greenboxServer home]$ id
uid=500(gitlab) gid=500(gitlab) groups=500(gitlab),488(git)


'git' groups:




sh-4.1$ groups
git
sh-4.1$ id
uid=495(git) gid=488(git) groups=488(git)
sh-4.1$

Answer



Changing directory requires the x permission on the directory. The r permission allows you to ls the directory but not cd into it.




Try chmod g+x /home/git



This may seem slightly confusing but the x permission has been re-used for this purpose because it doesn't make sense to "execute" a directory. Since that bit has no purpose for directories, it can be used to control access to change directory.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...