How to create and delete users in linux

Source: Internet
Author: User
Method for creating and deleting users in linux 1) add a new user in Linux, only the root user can create a new user. For example, # useradduser1. at this time, the user cannot log on, because the initial password has not been set, and the user without a password cannot log on to the system. By default... method for creating and deleting users in linux 1) add a new user in Linux, only the root user can create a new user. For example, # useradd user1. at this time, the user cannot log on, because the initial password has not been set, and the user without the password cannot log on to the system. By default, a user home directory with the same user name will be created in the/home directory. In Linux, when a user is added, a new group is created. The group has the same name as the user, and the user is a member of the group. If a new user belongs to an existing group, run the following command: # useradd-g usergroup1 user1 so that the user belongs to the usergroup1. If you want to make it belong to another group of usergroup2, use: # useradd-G usergroup2 user1 to set an initial password for it using the passwd command: # passwd user1 2) delete a user userdel <User name> It is best to delete the files that are left on the system. you can use "userdel-r username ". 3) add a group groupadd <Group name> 4) delete a groupdel group. <Group name>
Related Article

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.