Get the App
SLTechnology News&Howtos  ›  Servers  › 

User Management in Linux system

Shulou Source: shulou.com Published: 2022-06-03 03:38:15 11月12日 Update

In this issue, the editor will bring you about the user management in the Linux system, and analyze and describe it from a professional point of view. I hope you can get something after reading this article.

1 the significance of the existence of users and user groups

The user is the identity of the operator in the system

A group is a logical concept and a collection of users

The existence of users in order to classify users to facilitate the management of permissions

two。 The way users are stored in the system

The user is the string in the file in the system.

Each string maps the system resources used by the user

3 View of user information

Id to view the id information of the specified user

The common argument of the id command-u view the user's uid-g view the user's gid-G view the id-n of all groups in which the user belongs to display names instead of id numbers

4 user identity switching mode and environment variables

Logout command in the drawin

Gnome-session-quit-- force logs out the current user

Su and su-

Su only switches user identities, not user environment su-switches user identities and user environments

Note: every time the su switches to another user action, you must exit, and then switch to another user again. When the advanced user switches to the low-level user, you don't need a password, and the low-level user switches to the advanced user without a password.

5. Establishment and deletion of users and user groups, information management of users and user groups useradd establishment of groupadduserdelgroupdel

User deletes userdel-r user

Common parameters of useradd

-u specify the user's uid-g specify the user's gid-G specify the user's additional group-c specify the user's description-d specify the user's home directory, default is / home/username-s specify the user's default shell

Groupmod-g

Usermod

-l modify user name-u modify user's uid-g modify user gid-aG modify user additional group-c modify user's description-md modify user's home directory, default is / home/username-s modify user's shell type

Suggestion: use monitoring commands in the course of the experiment to see the changes more intuitively

6 user authentication management and authentication content analysis

/ etc/shadow user authentication information file

Modify the password

1:2: 3:4: 5: 6: 7: 8:9

Passwd westos (ordinary user)

Passwd (Advanced user)

Echo linux | passwd-- stdin root changes the password of root user to linux

Name modification command modification command passwd -? chage1. User name 2. User password-L3. Password expiration time-e-d4. The shortest period of validity of the password-n-m5. The longest period of validity of the password-x-M6. Password expiration warning-wW7. Password inactive days-i-I8. Password expiration date-E9. Reserved, unset bit

User authentication management

The above is the knowledge summary of user management in Linux system, the content is more comprehensive, the editor believes that there may be some knowledge points that we may see or use in our daily work. I hope you can learn more from this article.

Tags: User password switch system Administration Command Information user Group identity Authentication Advanced content Environment knowledge low-level valid Parameter name character string Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Huawei Docker vpn Linux