Last Updated: February 25, 2016
·
5.651K
· jmarizgit

Add/remove user from groups in unix

sudo usermod -aG <group> <username>

The "a" option is to maintain the groups which your username currently belongs to. The "G" option is to change the group.

Remove user from groups using gpasswd:

sudo gpasswd -d <username> <group>