Ubuntu Users Groups

From richud.com
Jump to navigation Jump to search

Add a user to a group

sudo usermod -a -G groupname username

The -a option is critical. The user is added to group1 while he continues to be a member of other groups. If it is not used, then the user is added only to group1 and removed from any other groups.

To let you start using that group immediately without needing to log out and in, then use newgrp to go in and out of that group.

sudo usermod -a -G disk rich
newgrp disk
newgrp rich