Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .