How to Fix Username is not in the sudoers file. This incident will be reported.
ROOT user account is the super user account, is able to modify system settings. but sometime wrong command execution itself damage root user account. And leave you somewhere you cannot move from there.
Users only get access to root only by using the sudo command as by default root user account is locked in Ubuntu.
When after executing wrong command and you loose privilege of accessing sudo.. that is referred as broken sudo.
See the image – 1 showing the error as Username is not in the sudoers file. This incident will be reported.
Image – 1
How to fix this broken sudo in Ubuntu.
Switch on the machine and keep tapping shift key to get the Grub boot menu. Select Advanced options for Ubuntu using the drop down arrow and press enter to get in to it as per image – 2.
$ mount -o rw,remount /
Now as the error says username is not in the sudoers file. lets now add user name in /etc/sudoers file.
$ nano /etc/sudoers then add the user name as per Image – 5
username ALL=(ALL:ALL) ALL
You may also like: How to resolve network wifi issue in Ubuntu 16.04 LTS