Linux Create root account

Source: Internet
Author: User

Method one. If you already have a regular account and want to upgrade it to the root type of account, follow the procedure below.

vi/etc/passwd


The UID and GID of the user who will be modified are set to 0. Save.

Method Two. If you want to create a root-type account directly, for example, if I create an account called Yuri, execute the following command under the system root account:

Useradd-u 0-o-G root-g root-d/yuri Yuri

This allows you to create a root-type account. Then set the password:

passwd Yuri

You will be prompted to enter your password two times. Success.

Command parsing:

-U 0: Specifies that the UID is specified as 0 (0) as root, and the prompt after login is # instead of $.
-O: This parameter must be specified because the UID is duplicated (repeat with the root account uid).
-G Root: The group name of the initialization group, when the user belongs to more than one group, (as specified in the-G parameter), the group in which the login is located. By default, the system creates a new group with the same name as the user name, and is set to the group name when it is initialized. Regardless of which group-G is specified.
-G root: Specifies the list of groups to which the user name belongs, a user can belong to more than one group, the group name is separated by commas, and the group name must already exist.
-d/yuri: Specify the user's home directory
Yuri New user name Yuri

Reference: http://blog.chinaunix.net/uid-22166872-id-3551122.html

This article is Eliot original, reprint please indicate source: http://blog.csdn.net/xyw_blog/article/details/40664229

Linux Create root account

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.