Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.