Group Management

Tarih: 2026-06-15 | Kategori: Linux

Etiketler: Linux

In Linux operating systems, group management is as important as user management. Groups are used to collectively assign the same access rights and permissions to multiple users. This enables system administrators to easily control resources and access. This section focuses on how to create, manage, and delete groups in Linux.

What is a Group in Linux?

[Image of Linux user and group architecture diagram]

In Linux systems, a group is a collection of users who have specific permissions and access rights. Groups are used to simplify access control in file systems and make user management more efficient.

Creating a Group

To create a new group, use the `groupadd` command. For example, to create a group named `development`, use the following command:

root@hackerbox:~$ sudo groupadd development

You can view the groups we have created in the `/etc/group` file.

root@hackerbox:~$ cat /etc/group

root:x:0:
daemon:x:1:
...
development:x:1004:

The `/etc/group` file may contain many groups, making it difficult to find the group you are looking for. To simplify your task, you can use the command below with `grep` to display only a specific group:

root@hackerbox:~$ cat /etc/group | grep development

development:x:1004:

Adding Users to a Group

To add users to the created group, use the `usermod` command with the `-aG` option. The `-aG` option adds the user to the specified group while preserving existing group memberships. For example, to add the user `john` to the `development` group, use the command below:

root@hackerbox:~$ sudo usermod -aG development john

Deleting a Group

To remove a group that is no longer needed, use the `groupdel` command. For example, to delete the `development` group, use the following command:

root@hackerbox:~$ sudo groupdel development

This command deletes the `development` group from the system.