Server Fault is a question and answer site for system and network administrators. 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 trying to set a shared directory in my server. There is 2 developper and they will work on the same directory.

I created a directory, change the group owner to www-data and chmod it to 755 :

drwxrwsr-x  3 root www-data 4096 2012-08-24 12:06 SharedDir/

But when i log in my directory with one dev login and try to touch a files it create a file with 644 perms

-rw-r--r-- 1 user1 www-data    0 2012-08-24 12:11 test

How can i create a mask to set the perms to 755 by default ?

share|improve this question

You'll want to set the umask on the directory.

share|improve this answer
How ? i tried to put a umask 0002 in a .bashrc but it doesn't work... – x_vi_r Aug 24 '12 at 10:26

If you want to have the execute bit set on files as default it isn't possible with umask. Because umask always is calculated from the maximum/base rights a "thing" can have.

directories: 777 files: 666

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.