Ubuntu tips: "XXX is not in the sudoers file" SOLUTION

Source: Internet
Author: User

Address: http://www.linuxidc.com/Linux/2010-12/30386.htm

 

When sudo is used, the system prompts "XXX is not in the sudoers file. This incident will be
Reported. XXX is your user name, that is, your user name does not have permission to use sudo. You just need to modify the/etc/sudoers file.

1) enter the superuser mode. That is, enter "Su -"

Su-

The system will ask you to enter the superuser password and enter the password to enter the superuser mode. That is, in the root user mode, it is also root for the root user to the password. Note that there is "-", which is different from Su. When "Su" is used, the system only switches to root, but does not pass the root environment variable, or the current user's environment variable. Use the "Su-" command to bring the environment variable together, just like root login.

2) Add the write permission for the file. That is, enter the command:

Chmod U + w/etc/sudoers
3) edit the/etc/sudoers file. That is, enter the command:

Gedit/etc/sudoers

Go to edit mode and find this line:

Root all = (all) All

Add it below:

Hadoop all = (all) All

Here, hadoop is your user name, and then save and exit.

4) revoke the write permission of a file. That is, enter the command:

Chmod U-W/etc/sudoers

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.