Liunx gives a common user root privilege common practice

Source: Internet
Author: User

CentOS gives a normal user root privileges

1, add the user, first with the AddUser command to add a normal user, the command is as follows:

#adduser Tommy//Add a user named Tommy

#passwd Tommy//Change Password


2

To modify the /etc/passwd file, locate the following line and change the user ID to 0 as follows:

Tommy:x:500:500:tommy:/home/tommy:/bin/bash

Modified as follows

Tommy:x:0:500:tommy:/home/tommy:/bin/bash

Save, with Tommy account login, directly get the root account permissions.


Supplemental Root:x:0:0:root:/root:/bin/bash

    • 3.User ID user identification Code, referred to as UID.

      The UID is used internally by the Linux system to identify the user, not the user name. The UID is an integer and the UID of the user is different. 0 is the system Administrator account number, 1-499 is the system reserved account, the engineer is General account

    • 4.Group ID User Group identification code, referred to as GID.

      Different users can belong to the same user group and have the permissions shared by that user group. Like the UID, the GID uniquely identifies a user group. Set with Usermod-g


Liunx gives a common user root privilege common practice

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.