Recovery from a broken sudo

July 28, 2006 at 3:29 am 1 comment

Ubuntu is probably the first distro that uses sudo instead of a root account. Recently, I started playing with it to help a friend out with a computer problem and discovered that sudo is rather fragile. For example, if you were to accidently delete or damage the /etc/sudoers file, sudo would stop working. You would not be able to get the sudoers back because you can’t sudo!

To recover, reboot your Ubuntu. At the boot manager, you should see an option for recovery, select that version and you’ll boot into root in text mode. From there, you can fix /etc/sudoers and everthing will be back to normal.

What did surprise me is that there is no root password. I thought when I type sudo, it was actually switching to root. Apparently, this is not the case. I am not sure if this would count as a security risk or not.

To avoid damaging your sudoers file, always edit it with sudo visudo. Visudo apparently checks the file for validity before saving it, so you don’t accidently damage your sudoers file.

Entry filed under: linux, ubuntu.

Subversion on a dual boot machine osql converted characters during execution

1 Comment Add your own

  • 1. Alan Yeates  |  August 2, 2006 at 10:49 pm

    Mine got broken through an unresovled repository request, it ain’t hard to do! The console usually still works however, not much help for us noobies!


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

Trackback this post  |  Subscribe to the comments via RSS Feed


July 2006
« Jun   Aug »

Most Recent Posts

%d bloggers like this: