Add users to sudoers under CentOS

Source: Internet
Author: User
After installing the system, CentOS cannot use the sudo command by default. in this case, we need to add the login user to the/etc/sudoers file and assume that the user name is tom and switch to the Super User: $ su-open the/etc/sudoers File: $ vi/etc/sudoers

After installing the system, CentOS cannot use the sudo command by default. in this case, we need to add the login user to the/etc/sudoers file.

 

 

Assume that the user name is tom.

 

Switch to Super User: $ su-

 

Open the/etc/sudoers File: $ vi/etc/sudoers

 

 

Modify file content:

Find the root ALL = (ALL) ALL row,

Insert a new row below with the following content:

Tom ALL = (ALL) ALL

Then, type the command "x!" in vi !" Force save and exit.

 

Note: This file is read-only and does not contain "!". Saving fails.

 

Exit Super User: $ exit

 

You can use sudo as much as you like.

Related Article

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.