Unix secondary groups – quick reference

Share This:

usermod -G group user – adds user to group/multiple groups
usermod -G sales testuser – example
Append user to existing group:
usermod -a -G group user – appends user to group/multiple groups
Link to man usermod http://linux.die.net/man/8/usermod

Removing user from a group:
gpasswd (administer /etc/group)
gpasswd -d user group – removes user from group
usermod -G group user – removes all the other groups apart from specified.
link to man gpasswd http://man.he.net/man1/gpasswd

Leave a comment

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload the CAPTCHA.