Article Directory
2.8 Users and User Groups
user concept
In computer systems, a user is an individual or entity that uses a computer system. Each user has a unique identifier (user ID), which is used to distinguish different users. Users can gain access to computer resources and perform specific operations by logging into the system.
The concept of user groups
A user group is the concept of aggregating a group of users together. User groups can easily manage and assign permissions, enabling users to share resources and access permissions. Each user group has a unique identifier (group ID), which is used to distinguish different user groups.
Relationship between users and user groups
There is a one-to-many relationship between users and usergroups. A user can belong to multiple user groups, and a user group can contain multiple users.
Administration of users and user groups
Within an operating system, specific commands and tools are available to manage users and user groups.
Some common user management operations include:
- Create User : Use
useradd
the command to create a new user. For example, a new useruseradd username
named will be createdusername
. - Delete user : Use
userdel
the command to delete a user. For example, the useruserdel username
named will be deletedusername
. - Modify user attributes : Use
usermod
commands to modify user attributes, such as user name, user ID, user group, etc. For example,usermod -l newname oldname
change the username fromoldname
tonewname
.
Some common user group management operations include:
- Create user group : Use
groupadd
the command to create a new user group. For example, a new user groupgroupadd groupname
named .groupname
- Delete user group : Use
groupdel
the command to delete a user group. For example, the user groupgroupdel groupname
named will be deletedgroupname
. - Add user to user group : Use
usermod
the command to add a user to a user group. For example, addingusermod -aG groupname username
a userusername
to a user groupgroupname
. - Modify user group attributes : Use
groupmod
commands to modify user group attributes, such as user group name, group ID, etc. For example,groupmod -n newname oldname
modify the user group name fromoldname
tonewname
.
Rights management for users and user groups
The management of users and user groups plays an important role in authority control. By assigning users to different user groups and assigning different permissions to user groups, fine-grained control and management of computer resources and system functions can be achieved.
For example, by setting specific user group permissions for a directory, members of the user group have read and write permissions to the directory, while other users cannot access it.
Summarize
Users and user groups are important concepts in managing and controlling user access rights in computer systems. Each user has a unique user ID, and a user group is a concept that aggregates a group of users, and each user group has a unique group ID. There is a one-to-many relationship between users and user groups. By properly managing users and user groups, authority control and management of computer resources and system functions can be realized. The management of users and user groups involves operations such as creating users and user groups, deleting users and user groups, and modifying user attributes and user group attributes. Understanding the concepts and management methods of users and user groups is helpful for reasonable configuration and management of user rights.