1./etc/passwd file to view user information
Match the user login name with the corresponding UID value, which contains some user information:
Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands. Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands
Use commas as delimiters to divide into 7 columns, which are:
We can directly change this file to add, delete, and modify accounts, but it is highly not recommended. This is very dangerous. If it is damaged, it will make it difficult for users to log in.
2.useradd add account
Commonly used methods:
Code language: javascript
Copy
useradd username -m -s /bin/bash -d /home/username -g groupname
Parameter description:
3.usermod change account
It is worth noting that usermod-p is used to change passwords, so be careful. The connection next to usermod-p is not plain text linux delete user, but ciphertext linux delete user, for example: usermod-p123user1, You thought you were changing user1's password to 123, but when you log in and enter 123, you will unfortunately find that you cannot log in.
4. Special tools passwd and chpasswd to change passwords
Passwdroot#Change root password
Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands.Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands
passwd-euser1# Force the user to change their password when they logged in last time.
Note: Ordinary users can only change their own passwords, and only root users have the permission to change other passwords.
chpasswd is used to change user passwords in Linux kernel in large quantities. It can manually read usernames and passwords through standard input
chpasswd Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands. Introduction to the basics of Linux for viewing, adding, modifying, and deleting user commands The above are the basic operations of adding, modifying, and deleting users. Due to space limitations, this article does not discuss the common operations of the Linux virtual host in the Linux group, which will be listed later. The above is the detailed content of Introduction to Linux Basics View, Add, Modify, and Delete User Commands. For more information, please follow other related articles on the PHP Chinese website!