Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

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

I cant seem to figure out how to achieve my goal to make a solution so all users within a grou work with the same set of files freely.

I got a group "developers", and they are developing a project. Now do i got number of users: user1:developers, user2:developers, user3:developers ... and etc.

Now they can create, run delete files in that project, but they can not save/edit files created by other users from the same project (group).

All files in the project got 770 permissions on them.

Is there a way to achieve this in CentOS Linux ?

share|improve this question
    
What permissions do the folders have? – Andreas May 15 '12 at 13:31
up vote 3 down vote accepted

Yes, you can use setgid and assign developers as the group owner of the folder, as follows:

chown nobody:developers /sharedfolder

Then,

chmod g+s /sharedfolder

Newly added files should now be read/write by all members of the developers group. If you have existing data in the folder already you'll need to do the chmod recursively with the -R switch.

share|improve this answer
    
Hi, I have been testing this, but it does not seem to fully solve the problem. Now when some user in the group creates a directory, it does not have the Write permission. Any ideas how to go around that ? – Katafalkas May 17 '12 at 14:06
    
another thing is that at the moment I keep putting 770 permisions on all the folders so people could work, but every time some1 edits some file or folder, entire directory becomes drwxr-x--- again. It all started after I made those modifications. I tried g-s but it still made no difference. – Katafalkas May 17 '12 at 14:29
    
It sounds like you need to adjust your default umask in /etc/bashrc. Using a value of 002 should do the trick. – Peet Corelli May 31 '12 at 16:55

Check http://www.psc.edu/general/unix/umask.php or http://en.wikipedia.org/wiki/Umask

What you need is have your user profiles edited to have a different umask so that files they create get default permissions that allow group to edit them.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .