XXX is not in the sudoers file. This incident will be report

  

This article describes the solution when encountering is not in the sudoers file during Linux use.

When using sudo, "xxx is not in the sudoers file. This incident will be reported."where XXX is your username, that is, your username does not have permission to use sudo, we only need to modify Just look at the /etc/sudoers file.

Example:
Problem Description

The following is the solution:

1) Enter Super User mode. That is, enter "su", the system will let you enter the super user password, enter the password and enter the super user mode.
Step 1

2) Edit the /etc/sudoers file. That is, enter the command "gedit /etc/sudoers", enter the edit mode, find this line: "root ALL=(ALL) ALL" Add "ld ALL=(ALL) ALL" below (the ld here is Your username), then save and exit.
Step 2

Switch to the normal user just added, execute the sudo command!

Another way to modify the /etc/sudoers file:

1) Enter superuser mode. That is, enter "su", the system will let you enter the super user password, enter the password and enter the super user mode.

2) Execute visudo (remember, there is no space between vi and sudo)

Move the cursor to "root ALL=(ALL) ALL“ below

Press i to enter the insert mode and add a configuration:

ld ALL=(ALL) ALL (where ld is your username)

3) Press Esc

4) Enter “:x”(Save and Exit)

Copyright © Windows knowledge All Rights Reserved