ubuntu--"XXX is not in the sudoers file. This incident'll be reported "error resolution

Source: Internet
Author: User

Ubuntu under the ordinary user with sudo execution command times title The error, the solution is to add permissions to the user in the/etc/sudoers file. As follows:

1. Switch to the root user

The 2./etc/sudoers file is read-only by default and is also for root, so you need to add the Write permission to the sudoers file first, the command is:
chmod u+w/etc/sudoers

3. Edit the Sudoers file
Vi/etc/sudoers
Find this line root all= (all) all, add the following to him xxx all= (all) all (here xxx is your user name)

PS: Here you can sudoers add any one of the following four lines
Youuser all= (All) all
%youuser all= (All) all
Youuser all= (All) Nopasswd:all
%youuser all= (All) Nopasswd:all

First line: Allows the user to execute the sudo command youuser (requires a password).
Second line: Allow user group Youuser inside user to execute sudo command (need to enter password).
Line three: Allow the user to execute the sudo command youuser, and do not enter a password at the time of execution.
Line four: Allow user group Youuser inside user to execute sudo command, and do not enter password at execution time.

4. Revoke sudoers file Write permission, command:
chmod u-w/etc/sudoers

ubuntu--"XXX is not in the sudoers file. This incident'll be reported "error resolution

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.