New user command format:
-
sudo useradd -m username, a user group with the same name will be created by default.
Example:
-
View user information
Use id command or /etc/passwd file
Example:
-
Set a password for the user
Use sudo passwd username
Example:
-
Switch users
using su-username
example:
-
Delete user
Use sudo userdel -r user name, the user group with the same name will be deleted by default.
Example:
Remarks: The above display is a teaching case to demonstrate the creation and deletion of users in the same group. It is not a specific operation suggestion and is for reference only. If it is helpful to you, it is an honor. Welcome to follow, like, comment, and forward.