Summary of how to add Root users in centos 5.5

Source: Internet
Author: User

This article introduces how to add a Root user in CentOS5.5. For more information, see.

V operating system: CentOS 5.5

1. Add a user. First, use the adduser command to add a common user:

The Code is as follows: Copy code
# Adduser junguoguo // Add a user named junguoguo
# Passwd junguoguo // change the password
Changing password for user junguoguo.
New UNIX password: // enter the New password here
Retype new UNIX password: // enter the new password again
Passwd: all authentication tokens updated successfully.

2. Grant root permissions
Method 1: Modify the/etc/sudoers file, find the following line, and remove the comment (#).

The Code is as follows: Copy code

# Allows people in group wheel to run all commands
% Wheel ALL = (ALL) ALL
Then modify the user and make it belong to the root group (wheel ):
# Usermod-g root junguoguo

After the modification is completed, you can log on with the junguoguo account and run the su-command to obtain the root permission for the operation.

Method 2: Modify the/etc/sudoers file, find the following line, and add a line under root, as shown below:

The Code is as follows: Copy code

# Allow root to run any commands anywhere
Root ALL = (ALL) ALL
Junguoguo ALL = (ALL) ALL

After the modification is completed, you can log on with the junguoguo account and run the su-command to obtain the root permission for the operation.

I think method 2 is the best method. For details, refer to the following.

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.