Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Possible Duplicate:
Make all new files in a directory accessible to a group

I have a directory in which collaborative files / directories are stored. Say directory abc is owned by root and the group is project-abc. I'd like for this directory to have the following:

  1. Only members of group project-abc are allowed to change the contents of this directory.
  2. Files added to abc must have read and write permissions set for members or group abc
  3. Directories added must have read, write and execute permissions for group abc

This is straightforward for static directories, but the contents of this directory are expected to change quite often. What's my best approach to producing the desired result?

share|improve this question
    
@Gilles, thank you for the reference link. Sorry I missed that in my search. –  ephsmith Jul 17 '12 at 2:28
add comment

marked as duplicate by Gilles, Stéphane Gimenez, Mat, Michael Mrozek Jul 28 '12 at 20:12

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

up vote 2 down vote accepted

The best thing you can do is to add the setgid bit (chmod g+s) to your directories. See Directory Setuid and Setgid in the coreutils manual. New directories will then preserve group ownership.

As for permissions, the best you can do is make sure umask 002 is in use every time someone works inside this directory.

(Yes, basic unix-style permissions are too basic sometimes… I don't know if ACLs can make collaborative work inside a directory easier. If they are activated in your system, you might have a look.)

share|improve this answer
    
Stéphane, thanks for your response. I have added the setgid bit for the top-level directory and that handles group ownership. Responsible users are handling the necessary permission modifications to directories and files that they create. Unfortunately, some don't. I'll look into your other recommendations. ACLs aren't activated ATM, but they are an option. –  ephsmith Jul 16 '12 at 16:07
add comment

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