Assigning a user to a group

Sometimes a user need to be assign to a existing group or to a new group.If the group is exists then just follow the command and if the group is a new one then first create the group using groupadd command and then follow the command.

usermod -a -G <group-name-2b-add> <user>

where,
g – primary group
G – upplementary group
a – option will add the user to a group without removing him/her from other groups.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: