0

This question already has an answer here:

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?

marked as duplicate by Byte Commander, Zanna, Gunnar Hjalmarsson, muru, Pilot6 Apr 11 '17 at 7:55

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

0

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.

  • 1
    If you're in single user mode, you're already in as root, so you can just run visudo without changing the root password. – Chai T. Rex Apr 11 '17 at 3:28

Not the answer you're looking for? Browse other questions tagged or ask your own question.