New user and delete user in Linux environment

New user command format:

  • sudo useradd -m username, a user group with the same name will be created by default.
    Example:
    Insert picture description here

  • View user information
    Use id command or /etc/passwd file
    Example:
    Insert picture description here
    Insert picture description here

  • Set a password for the user
    Use sudo passwd username
    Example:
    Insert picture description here

  • Switch users
    using su-username
    example:
    Insert picture description here

  • Delete user
    Use sudo userdel -r user name, the user group with the same name will be deleted by default.
    Example:
    Insert picture description here

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.

Guess you like

Origin blog.csdn.net/qq_41475067/article/details/112176154