Tuesday, January 25, 2011

How to make the new created filed with group rw permission

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

  • 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

    Master : I have edited my post for more specific
    From James

0 comments:

Post a Comment