Linux Add User To Group

Add new user to existing group

sudo useradd -G group_name user_name

Add new user to new group

sudo groupadd group_name
sudo useradd -G group_name user_name

Add existing user to existing group

sudo usermod -a -G group_name user_name

Change existing user primary group

sudo usermod -g group_name user_name
Categories: Linux Tags: , , , , , , , ,
%d bloggers like this: