How do I change a user's primary group?
I have a user 'Peter' with primary group 'users'. I want to change his primary group from 'users' to 'nogroup' with
Code:
usermod -G nogroup Peter Thanks. |
You probably meant -g. man usermod.
|
Code:
usermod -g nogroup printuser Is there a command to assign 'nogroup' as the new primary group with no secondary group? Thanks ! Quote:
|
After you change the primary group for user successful, then issue:
usermod -G <the_only_primary_group> <user> |
Handily change the current user's primary group
I've tried a variety of all of these, and I must warn others - be careful.
The following command will change a user's primary group. All set? Code:
usermod -g group user If you simply want to add a user to a supplementary group (retaining existing groups) run this. Code:
usermod -a -G group user Code:
newgrp group |
All times are GMT -5. The time now is 11:08 PM. |