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

I have centos 5.4.

I in joomla website , when i install new php script then it created its own folder like images/scriptname

Now that folder has only read and write permission for that user or apache user i don't know.

I want that all the files created under /home/ directory has group write permission by default.

I don't want specific folder or specific user but for all users folder inside /home directory

Is it ok to do , or there is any other solution for that

EDIT

SUppose in my /home directory i have three user

/home/user1
/home/user2
/home/user3

Now i want that if any file is created under user1 it should have by default group rw permission with group being user1

and for /home/user2 all file which are created later should have default group rw permission with default group being user2

How can i achieve that

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You would need to set the umask on the directory. This will allow every file/directory that is created to have default permissions beyond the normal rw--r--r-- that most files are given.

So, if you have a folder called /home/myscripts and you want every file under it to be created by default as rw-rw-rw- you need to set the umask to 011, or:

# umask 011 /home/myscripts

For more information: http://www.comptechdoc.org/os/linux/usersguide/linux_ugfilesp.html

share|improve this answer
    
I have edited my post for more specific –  John Jun 16 '10 at 1:42

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.