[NTLUG:Discuss] persistent umask for a directory?
Chris Cox
cjcox at acm.org
Wed Jul 11 11:52:55 CDT 2007
Stuart Johnston wrote:
> Is there a way that I can have new files created in a particular
> directory automatically be writable by all users?
>
> I thought I had done this before but now I can't figure it out.
>
Not easily. You can have all files tagged with a particular
group pretty easily. Alternatively you can deploy ACLs, but
that would not be my first choice (it can cause a plethora
of problems unless you fully understand what you are doing).
To force group ownership (that is, that all files placed
inside of a directory will have the same group owner):
$ mkdir mygroupdir
$ chgrp somegroup mygroupdir
$ chmod g+s mygroupdir
$ chmod 770 mygroupdir
Now the only people with access to the dir is the
owner of the dir and the members of somegroup. When
a member of somegroup writes into the dir, the file
is created with the group of somegroup.
So... it's not exactly what you were looking for, but
this might be useful.
In order to do the above things as a normal user,
the user must belong to somegroup (does not need
to be the primary group of that user though).
More information about the Discuss
mailing list