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
sh-4.1$ id
uid=495(git) gid=488(git) groups=488(git)

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.

  • Thanks, settings g+x for /home/git also fixed permissions for /home/git/repositories. – greenboxal Jul 3 '12 at 9:59
  • I like to think of +x on directories as allowing you to execute a move into that directory. – EightBitTony Jul 3 '12 at 9:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.