Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I broke sudo when I wrongly edited a file in /etc/sudoers.d in vi(did not use visudo :-().

I read that I could fix the same by rebooting into the 'Recovery Mode' by selecting the same from the grub menu.

However I'd earlier disabled the showing of the grub menu by editing /etc/default/grub. As a result I can't seem to go into recovery mode to fix my broken sudo.

How can I fix sudo now??

share|improve this question
1  
Well, at least you've just learned a valuable lesson. –  Rein Henrichs May 5 '11 at 16:46
    
@Rein, you betcha.. :-) –  Abhijith May 5 '11 at 16:55
add comment

1 Answer 1

up vote 4 down vote accepted

Hold Shift while booting, this will cause GRUB2 to show the boot menu. Next, after booting in Recovery mode, select Root shell. From there, you can edit your sudoers file by running visudo without sudo before it, you're root anyway ;)

share|improve this answer
    
This is useful to get hold of the grub2 boot menu too. Thanks. –  Abhijith May 5 '11 at 17:00
    
To document an earlier answer which seems to have dissappeared by the time I tried it out(It worked for me). "Grab a live CD. Boot into it. Mount your root file system. Fix sudo". –  Abhijith May 5 '11 at 17:01
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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