Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
How to modify a invalid /etc/sudoers file? It throws error and not allowing to edit again

I really did some very stupid stuff.

I did a sudo visudo and wanted to add the following line:

%admin ALL = NOPASSWD: /bin/tar

so users can execute /bin/tar without the need to sudo.

But stupid me replaced the line

%admin ALL = (ALL)ALL

So basically that means I'm totally locked out. Everytime I try a sudo visudo I get

"Sorry, user admin is not allowed to execute '/usr/sbin/visudo' as root on myhost"

I only can tar. Great.

Is there any way to get my root rights back?

share|improve this question
    
You're right, the answer there should solve the problem. Thanks for the link! –  acme Jan 18 '12 at 12:13
add comment

marked as duplicate by Bruno Pereira, Lekensteyn, binW, Jorge Castro, bodhi.zazen Jan 18 '12 at 16:28

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.

1 Answer

up vote 1 down vote accepted

the easiest way would be to boot your system from live cd, mount your root file system and modify its /etc/sudoers file to fix the issue.

share|improve this answer
    
Yeah, this is what I did (got the solution some minutes before your answer from Bruno's linked question above) and it worked. So, kudos to you, too ;-) –  acme Jan 18 '12 at 13:21
add comment

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