Users, groups and directory access

Matthew Miller mattdm at mattdm.org
Wed May 5 19:51:31 UTC 2004


On Wed, May 05, 2004 at 03:31:15PM +0200, A.J. Bonnema wrote:
> >>usermod -G proj john
> >This is bad because it *replaces* the current list of groups. If john was
> >previously a member of 'staff' or 'proj2', that would be removed. This is
> >why gpasswd -a is usually better.
> Do you mean, only one group will result from this command? I mean, will 
> the primary group be replaced too? I executed this command and after 
> groups I got: john, as the only group. After logoff/logon I got: john 
> proj, as the groups output.

It'll not do anything to the primary group, but it'll completely replace the
list of supplemental groups with that given. (In either case, it won't
affect the user until s/he logs out and in again.)


> >But this is basically obsolete -- there's almost never a reason to do this.
> Then I wonder what the use of a primary group is: is there any 
> preference in the system for the primary group? In what circomstance?

Well, when you create new files, that's the default group for them to be in.
But the g+s option is generally a better way to deal with this.


-- 
Matthew Miller           mattdm at mattdm.org        <http://www.mattdm.org/>
Boston University Linux      ------>                <http://linux.bu.edu/>





More information about the fedora-list mailing list