On Wed, May 05, 2004 at 03:30:07AM -0500, David L Norris wrote:
# root can change john's group membership like this 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.
However, I'll do some experiments on a fake user to try this one out.
How can john change his primary group on the commandline?
newgrp proj
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?
Guus -- never too late to learn -- -- A.J. Bonnema, Leiden The Netherlands, user #328198 (Linux Counter http://counter.li.org)