Create new users and delete users under Linux

Source: Internet
Author: User

Add Users:

Use AddUser username create, need super privilege, can get temporary permission with sudo sudo adduser username, enter the password, fill in the information, confirm the creation.

View the user list with VI/ETC/PASSWD

PXL:X:1001:1001 's pxl is the user name, X is the password, the first 1001 is the user ID, and the second 1001 is the group ID.

Viewing user groups with Vi/etc/group

PXL:X:1001 's pxl is the user name, X is the password, and 1001 is the group ID.

To delete a user:

Using Userdel username to delete the user, first Su root into the super user, and then Userdel username, the Userdel:user pxl is currently logged in the hint, the result is unable to delete, So I used Userdel-r-f username, forcing the deletion of all files related to this user, including home directories and user mailboxes, Userdel-r username Delete all files related to this user, and Userdel username Delete account and group information , home directories and user mailboxes are still in, the user I just created does not have a mailbox. Switch User pxl again no more, delete complete.

Create new users and delete users under Linux

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.