From the course: Linux CentOS 7: User and Group Management

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Manage groups

Manage groups - Linux Tutorial

From the course: Linux CentOS 7: User and Group Management

Start my 1-month free trial

Manage groups

- [Instructor] Groups are an important part of the Linux User Management system. However, groups have one major limitation. They can't be nested, so you can't have a group within a group. To create a group, we use Group Add. Group Add has a few options, but the most common is -g for specifying the group ID. Let's create a group called Accounting with the group ID of 1050. In a terminal, type in sudo, space, groupadd, space, -g, space, 1050, space, accounting, and hit Enter. Type in your password and hit Enter again. We can verify this by viewing the etc group file. Type in cat, space, /etc/group, and hit Enter. We see the last line has our accounting group, and the group ID is 1050. If, later, we want to modify attributes of our group, we can with Group Mod. For instance, if we want to change the group ID, we would type in sudo, space, groupmod, space, -g, space, 1051, space, accounting. This will change the group ID of the accounting group to 1051. If accounting were the primary…

Contents