On 8/16/2010 1:28 PM, Mike Miller wrote:
> Every user on the system is in his own group, so files for user "bob" are 
> created by default with owner "bob" and group "bob".  Most users are also 
> in a group called "staff".  I want to make a shared space for the staff 
> group where every file and subdirectory created within our staff directory 
> always has the group "staff" (recursively for the whole tree).  This will 
> be our shared space.  How can I do that?
Set the sgid bit on that directory and change its group to staff. Files
created in that directory will automagically have its group set to
staff. Files transferred to that directory will not be changed
automatically though, so if you are transferring files to it more than
creating new ones, this may not be practical. Also, the default umask
might not be practical since it only gives the group read access. I've
used this set up with an FTP share and it worked wonderfully (I could
change the umask for uploaded files, which doesn't affect the users'
umask value(s) outside FTP).
On a related note, does anyone know why the Linux kernel ignores the
suid bit on directories?