Linux Users and Groups

Understanding users and groups is essential for becoming an effective Linux user.

How to assign a user to a group

Assigning a user to an existing group. first you can see which groups the user is part of

For example the root user is part of the root group

groups root
root : root

To add a user to an excising group

usermod -a -G <group name> <user name>

How to create a new group

To add a new group in Linux use the “groupadd” command. Note: adding groups requires root privileges.

sudo groupadd GroupName

Leave a Comment