What is a group in linux

WBOY
Release: 2022-03-15 17:23:29
Original
5307 people have browsed it

In Linux, a group is a logical collection of users with the same characteristics. Using groups is conducive to organizing and managing users according to user characteristics; a user belongs to at least one group. When a user belongs to multiple groups is a member of a user, one of the groups is the user's main group, and the other groups are the user's subsidiary groups.

What is a group in linux

#The operating environment of this tutorial: linux7.3 system, Dell G3 computer.

What is a group in Linux

1. Overview

A group is a logical collection of users with the same characteristics , using groups helps system administrators organize and manage users according to their characteristics and improve work efficiency.

  • When authorizing resources, you can grant permissions to a group, and members of the group can automaticallyobtain such permissions.
  • A user account belongs to at least one user group. When it is a member of multiple groups, one of the groups is the user's main group (private group), and the others The group is the user's affiliated group (standard group).

2. User group account file

User group configuration file/etc/group

What is a group in linux

User group password file/etc/gshadow

What is a group in linux

3. Group account management

Create user group

groupadd [options ] User group name
What is a group in linux
option is used to set the parameters of the user account. The main options are as shown in the table

Parameters Description
-g Group ID is used to create a user group with the specified GID number

##Example: Create a user group named networks with a GID of 1030
What is a group in linux

Modify the attributes of the user group

Modify the group Command:

groupmod [options] User group name

ParametersWordsDescription-ggidChange the group’s GID to gid-ngroup-nameChange the name of the group to name (rename)-oForce the GID of the group that accepts changes to be a duplicate number

Maintain user group accounts

Format of the gpasswd command:

gpasswd [options] [User] [Group]

##Parameter-a-d-r-ADelete the user group
Description
Add user to group
Remove user from group
Cancel the password of the group
Assign an administrator to the group

This command

can only be used by the root user

. Before deleting a specified user group, you must ensure that the user group is not the primary group of any user. Otherwise, you need to delete the accounts of the primary group first and then delete the user group. Use the groupdel command to delete Format: groupdel Username

Related recommendations: "

Linux Video Tutorial

"

The above is the detailed content of What is a group in linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template