[visudo] Username is not in the sudoers file


Username is not in the sudoers file. This incident will be reported

Besides making sure that your username is in sudo group (I think it is), there are other cases that cause this problem. Some of them may have something to do with sudoers file (/etc/sudoers)

in my case, i accidently commented out 1 important line of the file, which is:

%sudo ALL=(ALL:ALL) ALL

Since you no longer have sudo permission anymore, you would need PolicyKit to fix the sudoers file. This fix does not require rebooting the device or console (physical) access. You can do it from your ssh session.

credit EstalillaJ

Now, you can run pkexec visudo to fix your sudoers file. For more detail, see this.

Facebook Comments
,

Leave a Reply