Detailed steps for creating and Deleting Users in linux

Source: Internet
Author: User

Detailed steps for creating and Deleting Users in linux
In linux, user operations are relatively easy to understand. The basic operations are as follows: 1. Only root users can create new users.

# Useradd user1
A user home directory with the same user name is generated in the/home directory.
A new group is created, which has the same name as this user and belongs to this group.
To assign a new user to an existing group, run the following command:
# Useradd-g usergroup1 user1
In this way, the user is a member of usergroup1.
If you want to make it belong to another group of usergroup2, use:
# Useradd-G usergroup2 user1
Use the passwd command to set an initial password for new users to log on:
# Passwd user1
2. delete a user
Userdel <User Name>

Delete files from the system. You can use

Userdel-r user name

3. Add a group
Groupadd <Group Name>
4. delete a group
Groupdel <Group Name>


The end...

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.