New and deleted users in Linux can use the command: Useradd

Source: Internet
Author: User

  1. New and deleted users in Linux can use the command: Useradd

    Let's first use the man command to understand the use of useradd.

  2. New and delete user actions need to get advanced user Rights First

    Input command: Sudo-i

    Enter advanced user password after OK

  3. Create a new user Cindy using Useradd

    Input command: Useradd Cindy

  4. Create a home folder for users

    Input command: Test–d/home/cindy

  5. Take a look at the information about the user Cindy you just created

    Input command: grep cindy/etc/passwd/etc/shadow/etc/group

    Create a row of account-related data in/etc/passwd, including creating a Uid/gid/home folder, etc.

    In/etc/shadow, fill in the password related parameters of this account.

    Add a group name that is the same as the account name in/etc/group

  6. Set the password for the created account, there is no way to set the password to login, we still first use the man command to understand the usage of passwd

  7. Input command: passwd Cindy

    After confirmation, you will be prompted to enter a new password, once again confirm the password

    If the password is the same, the prompt changes successfully

    If the password is inconsistent two times, the prompt change is unsuccessful

  8. Now let's use the newly created user Cindy Login to see it.

    Input command: su Cindy

    OK to enter Cindy User action

  9. 9

    Remove add extra user, include user's home folder to delete together

    Input command: Userdel–r Cindy

New and deleted users in Linux can use the command: Useradd

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.