Archive for July 28, 2006

Recovery from a broken sudo

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.

Advertisements

July 28, 2006 at 3:29 am 1 comment


Calendar

July 2006
M T W T F S S
« Jun   Aug »
 12
3456789
10111213141516
17181920212223
24252627282930
31  

Posts by Month

Posts by Category