Detailed steps for creating and deleting users under Linux

Source: Internet
Author: User

Linux under the user's operation is relatively easy to understand, the basic operation is as follows:

1. New Users

Only the root user can create a new user

[Plain] view plaincopy650) this.width=650; "src=" Https://code.csdn.net/assets/CODE_ico.png "width=" 12 " Height= "alt=" on code to view the chip "style=" Border:none; "/>650" this.width=650; "src=" Https://code.csdn.net/assets/ico _fork.svg "width=" height= "alt=" derived from My Code slice "style=" border:none; "/>

    1. #useradd user1

When created, a user home directory with the same user name will be generated in the/I directory.
A new group is also created that has the same name as the user who belongs to the group.
If you want a new user to belong to a group that already exists, use the following command:

[Plain] view plaincopy650) this.width=650; "src=" Https://code.csdn.net/assets/CODE_ico.png "width=" 12 " Height= "alt=" on code to view the chip "style=" Border:none; "/>650" this.width=650; "src=" Https://code.csdn.net/assets/ico _fork.svg "width=" height= "alt=" derived from My Code slice "style=" border:none; "/>

    1. #useradd-G Usergroup1 user1

The user is then part of the Usergroup1 group.
If you want it to belong to a group usergroup2 again, use:

[Plain] view plaincopy650) this.width=650; "src=" Https://code.csdn.net/assets/CODE_ico.png "width=" 12 " Height= "alt=" on code to view the chip "style=" Border:none; "/>650" this.width=650; "src=" Https://code.csdn.net/assets/ico _fork.svg "width=" height= "alt=" derived from My Code slice "style=" border:none; "/>

    1. #useradd-G usergroup2 user1

Use the passwd command to set an initial password for the new user to log in:

[Plain] view plaincopy650) this.width=650; "src=" Https://code.csdn.net/assets/CODE_ico.png "width=" 12 " Height= "alt=" on code to view the chip "style=" Border:none; "/>650" this.width=650; "src=" Https://code.csdn.net/assets/ico _fork.svg "width=" height= "alt=" derived from My Code slice "style=" border:none; "/>

    1. #passwd user1

2. Delete users

[Plain] view plaincopy650) this.width=650; "src=" Https://code.csdn.net/assets/CODE_ico.png "width=" 12 " Height= "alt=" on code to view the chip "style=" Border:none; "/>650" this.width=650; "src=" Https://code.csdn.net/assets/ico _fork.svg "width=" height= "alt=" derived from My Code slice "style=" border:none; "/>

    1. Userdel < user name >

The files on the system are also deleted and can be used


[Plain] view plaincopy650) this.width=650; "src=" Https://code.csdn.net/assets/CODE_ico.png "width=" 12 " Height= "alt=" on code to view the chip "style=" Border:none; "/>650" this.width=650; "src=" Https://code.csdn.net/assets/ico _fork.svg "width=" height= "alt=" derived from My Code slice "style=" border:none; "/>

    1. userdel-r User Name


3. New group

[Plain] view plaincopy650) this.width=650; "src=" Https://code.csdn.net/assets/CODE_ico.png "width=" 12 " Height= "alt=" on code to view the chip "style=" Border:none; "/>650" this.width=650; "src=" Https://code.csdn.net/assets/ico _fork.svg "width=" height= "alt=" derived from My Code slice "style=" border:none; "/>

    1. groupadd< Group name >

4. Delete a group

[Plain] view plaincopy650) this.width=650; "src=" Https://code.csdn.net/assets/CODE_ico.png "width=" 12 " Height= "alt=" on code to view the chip "style=" Border:none; "/>650" this.width=650; "src=" Https://code.csdn.net/assets/ico _fork.svg "width=" height= "alt=" derived from My Code slice "style=" border:none; "/>

    1. Groupdel < group name >


The end ...

    • previous Linux using Yum to install SVN detailed


650) this.width=650, "src=" http://images.cnitblog.com/blog/437282/201411/041405283617635.gif "width="/>

Moe's IT People

Detailed steps for creating and deleting 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.