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'm working on the same directory with some friends and they access it via SSH.

I added us in the same group and defined a sticky bit to keep the user:group values the same.

But when a user create a file/folder, the Write attribute is not defined for the group, disabling other to write it/on it.

How can I define the Umask to add the Write value for groups in the specific directory and it's subfolders ?

I tried to find some help before, but I only saw helps for Fedora/CentOs, and I'm using Debian Squeeze.

Thanks for your help

share|improve this question
up vote 4 down vote accepted

I assume that you did already:

chmod g+rwxs directory

and now you have to make sure that the users have a umask like 002. To setup the umask for all the users, try in /etc/bashrc or /etc/profile.

caveat: you cannot setup a umask per directory as it's a process level thing.

Interesting read

share|improve this answer
Thanks for this help. Does it works when using ssh over git ? – Cyril N. Jun 28 '13 at 13:14
tbh I am not sure but, because you are using a unix user anyway even with git, in theory it should work. – zekus Jun 28 '13 at 13:21
You actually can set a umask per directory using Linux ACLs, e.g. use setfacl -R -m group:groupname:rw-,d:group:groupname:rw- directory/ to force the r and w permission for the group "groupname" on a directory – bricklore Dec 10 '15 at 17:12

The umask is an attribute of a user's environment (more specifically, a process) rather than a directory. So each of the users sharing that directory should add the following umask command to their ~/.profile:

umask 002

This will make files they create group-writeable by default.

share|improve this answer
umask 002 ~ chomd 775 – Ryu_hayabusa Jan 9 '15 at 14:25

You must log in to answer this question.

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