How to Add One User to Multiple Groups


The utility is usermod and is used like:

usermod -a -G group1,group2 username

Where username is the user you want to modify and group1 and group2 are the new groups you want that user to join. Running the command without the -a argument will remove that user from all groups except group1 and group2.

To check a users group memberships use the groups command:

groups username
This entry was posted in Linux, UNIX and tagged , , , , , , , . Bookmark the permalink.