Create groups

To create groups in Linux, you can use a tool called addgroup. addgroup is a friendlier front-end to the low level tool groupadd.

The syntax of this command is simple: you just type addgroup, followed by the name of the group. You can also provide a specific GID (Group ID) for the group with the –gid NUMBER parameter. If you omit this parameter, addgroup¬†will use the next available GID.

Let’s create a group called test_group with the GID of 2000:

linux addgroup command

Groups are created with no users. To add a user to the group, use the adduser command with two parameters: the username and group. For instance, to add the user jowilliams to the group test_group, we would use the following command:

linux adding user to a group

Subscribe to our Newsletter

Like us on Facebook

top
Geek University 2019