Server Fault is a question and answer site for system and network administrators. 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

OS: Ubuntu 12.04

I have a directory what has given write permission to group foo. Two users bar and baz are part of the group. Both can successfully write files to the directory. However, baz cannot overwrite a file (i.e. create a file with the same name) that was written by bar. I'm doing the file I/O through Python (csv module), but I don't think that has anything to do with this problem.

How do I set permissions so that bar and baz can overwrite eachother's files in the foo directory?


share|improve this question
up vote 0 down vote accepted

You can change the mode of the directory to setgid to ensure that new files are created with the same group as that owning the directory. See this article for more information: .

The command is: chmod g+s /path/to/directory

share|improve this answer

When user creates file, the default permissions don't allow write to group. You need to change the umask so newly created files will have write permissions for group:

umask 0002

To know what is the current umask, run it without args.

See man umask for more info.

share|improve this answer
Thanks @shimon! I just ran umask in the foo directory with no args, it returned 0002 – NP01 Feb 12 '13 at 7:33
AFAIK, You set it once and it persists until you change it.. – Shimon Rachlenko Feb 12 '13 at 7:34
umask only limits the max permissions so if the application doesn't request group write then umask has no effect. – Iain Feb 12 '13 at 7:35

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.