I added something in visudo
and now when I want to run sudo
it gives me the following error: Sorry, user reza is not allowed to execute '/bin/su' as root.
What should I do?
Since sudoers appears to be screwed up, you will have to first log in as root. To do this, simply type su -
You should then be prompted for the root password. After you log in as root, run:
visudo
After you're into the sudoers file, find the mistake and fix accordingly.
If you don't know the root password, then unfortunately you may have to "single" the host and reset it. If this is the case, do a search for "single user mode Ubuntu" and you'll find instructions on how to reset the root password.
root
, so you can just run visudo
without changing the root
password.
Apr 11, 2017 at 3:28