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