Linux under: XXX isn't in the sudoers file

Source: Internet
Author: User

  1. Problem description--what

Ready to build a lamp environment on a virtual machine's Linux (Centos) system using: sudo yum install httpd; prompts need to be converted to administrator mode.

So I switched to root using the sudo command, and I found a hint: LMS is isn't in the sudoers file

   2. Cause of the problem--when/why

  The reason:

1.when--When you use sudo to switch root, but not every time you use the command, you will encounter this problem

2.why--LMS user not added to sudo config file

3. Resolution--how

    Solution:--how
1. First need to switch to root identity
$SU-

(SU and su-command differences:

1. Command "su" when only switch to root, but not the root environment variable passed, or the current user's environment variables;

2. Use the "Su-" command to bring the environment variables together, as with the root login)

2. Then: $visudo// Note that there are no spaces between VI and sudo here

1. Move the cursor to the last line
2, press A, enter the Append additional mode
3. Input
Your_user_name (example: LMS) all= (All) all
4. Press ESC
5. Enter ": Wq" (Save the file and exit)

Add yourself to the sudo group above and you can use the sudo command

(PS: There will be a period of time not to write a blog, will be the blog you have written before a certain layout, and then continue to write)

  

Linux under: XXX isn't in the sudoers file

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.