When set on directories, the setgid bit freezes group ownership and
permissions for all child directories and freezes group ownership for
all child files.
As root,
chgrp users /shared
chmod g+s /shared
This sets the group on "/shared" to "users" and forces all directories
and files subsequently created under "/shared" to have group "users".
Not too often understood or needed, but handy as heck when it is.
-mj-
Craig White wrote:
> On Thu, 2004-06-24 at 20:17, Alan Dayley wrote:
>
>>I have googled and checked the PLUG archive but I can't come up with the
>>right search terms to hit the answer to this problem.
>>
>>Let's say that one Linux computer is shared by two people. They take
>>turns logging in and all is well. However, they have created a directory
>>called /shared for sharing files between each other. UserA creates a
>>document or other file and saves it as /shared/file1. When UserB logs in
>>they want to edit /shared/file1. But the owner and group permissions on
>>/shared/file1 are set to UserA and UserB can't edit and save it.
>>
>>Both UserA and UserB are in the group Users. If /shared/file1 is set to
>>group Users, they now can both access it. But, as soon as one creates a
>>new file, like /shared/file2, it has the group set to the user who created
>>it!
>>
>>How does one set the permissions and ownership of the /shared directory
>>such that all files created there have the correct group always set no
>>matter which user is the owner?
>
> ----
> chmod g+s /shared
>
> Craig
>
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss@lists.plug.phoenix.az.us
> To subscribe, unsubscribe, or to change you mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
---------------------------------------------------
PLUG-discuss mailing list -
PLUG-discuss@lists.plug.phoenix.az.us
To subscribe, unsubscribe, or to change you mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss