How to Create users and groups in Linux

Source: Internet
Author: User
How to Create users and manage group users in Linux, the main task is to create a legal user account, set and manage user passwords, modify user account attributes, and delete obsolete user accounts when necessary. 1) to add a new user in Linux, only the root user can... how to Create users and manage group users in Linux, the main task is to create a legal user account, set and manage user passwords, modify user account attributes, and delete obsolete user accounts when necessary. 1) add a new user in Linux. only the root user can create a new user. the following command creates a new user with the login user1. Www.2cto.com # useradduser1. However, this user cannot log on yet, because the initial password has not been set for it, and users without a 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 you want a new user to belong to an existing group, you can use the following command: # useradd-gusergroup1user1 so that the user is a member of the usergroup1 group. And if you want to make it belong to another group of usergroup2, you should also use the: # useradd-Gusergroup2user1 to complete this operation, you should also set an initial password for it using the passwd command. 2) to delete a user, you only need to use a simple command "userdel user name. However, it is best to delete the files that remain on the system. you can use "userdel-r username" to achieve this purpose. 3) to add a group, we can create a user group as needed: www.2cto.com groupadd <Group name> 4) when deleting a group, we sometimes need to delete a group. its command is groupdel. This article is from the red union Linux Portal
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.