0

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

2
  • 1
    Well, at least you've just learned a valuable lesson. May 5, 2011 at 16:46
  • @Rein, you betcha.. :-) May 5, 2011 at 16:55

1 Answer 1

4

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

2
  • This is useful to get hold of the grub2 boot menu too. Thanks. May 5, 2011 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". May 5, 2011 at 17:01

You must log in to answer this question.

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