In linux, is there a way to set a default permission for newly created files and directories under a
Posted
by David Dean
on Stack Overflow
See other posts from Stack Overflow
or by David Dean
Published on 2009-02-24T05:33:59Z
Indexed on
2010/03/29
15:23 UTC
Read the original article
Hit count: 462
I have a bunch of long-running scripts and applications that are storing output results in a directory shared amongst a few users. I would like a way to make sure that every file and directory created under this shared directory automatically had u=rwxg=rwxo=r
permissions.
I know that I could use umask 006
at the head off my various scripts, but I don't like that approach as many users write their own scripts and may forget to set the umask themselves.
I really just want the filesystem to set newly created files and directories with a certain permission if it is in a certain folder. Is this at all possible?
Update: I think it can be done with POSIX ACLs, using the Default ACL functionality, but it's all a bit over my head at the moment. If anybody can explain how to use Default ACLs it would probably answer this question nicely.
© Stack Overflow or respective owner