[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
,

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x