Linux Add Group

Linux Add Group

 Linux Add Group


Use groupadd or addgroup command to create a new user group in the Linux system.

Syntax:

$ addgroup GROUP_NAME

Example:
Let’s create a group named “testgroup”.

$ addgroup testgroup

Add User to Group

Use usermod command to add user in the secondary group.

$ usermod -G testgroup testuser

You can view the group’s names of the user belongs to.

$ groups testuser

testuser : testuser testgroup 

Assign Group during Create New User

You can also assign a specific group during create creation process. This will also create the primary group

$ useradd -G testgroup rahul
Souy Soeng

Souy Soeng

Our website teaches and reads PHP, Framework Laravel, and how to download Admin template sample source code free. Thank you for being so supportive!

Github

Post a Comment

CAN FEEDBACK
close