Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Can I somehow specify that:

  • in a directory repository.git
  • all files will ALWAYS have
  • mode 770 and
  • git:www-dat a ownwership:groupship?
share|improve this question

permissions - mount with ACL options ownership - Your looking at setuid and setgid bits...

an example of what it looks like you are trying to do is here:

share|improve this answer

If you can enforce that applications that create files in this directory run with umask 007, and create files with no restriction on permissions, and run with group www-data as their effective or supplementary group, then all you need to do is chmod g+s repository.git. Otherwise, you can't do exactly what you request.

However, if you make the directory itself owned by git:www-data and mode 770, only the git user and the www-data group will be able to access files in the directory. Even if the files in the directory are world-readable, other users won't be able to access them unless they're hard linked elsewhere or you hand them a descriptor to the directory (which you'd pretty much have to do deliberately).

Next is the problem of making the files group-writable. You can do that if the filesystem has access control lists enabled. For ext2/ext3/ext4/reiserfs, make sure it's mounted with the acl options. Install the ACL command line tools (e.g. you need the acl package on Debian or Ubuntu).

chmod 770 repository.git
chown git:www-data repository.git
setfacl -m user:git:rwx -m group:www-data:rwx repository.git
setfacl -d -m user:git:rwx -m group:www-data:rwx repository.git

I don't think the files will end up executable unless the applications create them to be executable. I don't know how to remedy this.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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