Thursday, July 27, 2006

 

Sweet Recovery Mode and its Uses

Hot water with sudoers
Got into hot water the other day, while modifying sudoers.

Thank God for IRC and the Ubuntu community. In a quarter of an hour, a very sweaty quarter of an hour, had the answer, and it worked a treat. If not mistaken, the user who gave me a concise, reliable piece of advice was rjib.

As all of this is new and odd, the lay of the land is not yet clear. Opened sudoers with visudo, as ought to. But default editor is nano. Think wanted a quick fix, to be able to open it with gedit. Or some other silly reason.

Ran chmod on etc/sudoers, the address of the sudoers file:

sudo chmod u+w /etc/sudoers

Don't recall if was pleased when ls -l showed that sudoers now indeed had a user write permission, but if any content there was, it was short-lived...


The catch of being locked out of sudo
The real result of the above clever tweak was being locked out of using sudo at all. Every time tried to use sudo, the system would tell me that the permissions on sudoers were wrong, and prompt me anew, without heeding my 'commands'. So, the system allowed me to paint myself into a corner...

Because, mind you, any imaginable way out involved being superuser. That includes, of course, changing to root:

sudo -i

...

Recovery Mode, the Knight in Shining Armor Gallops to the Rescue
rjib's advice was to restart in recovery mode.
In recovery mode, you're on the console, withtout a GUI...
But, you're root, the superuser...

Restarted, edited out the changes made to sudoers, and was good to go...

Obviously, with the power of being root in recovery mode, comes a power to harm. So, be forewarned...

Comments:
I love your Blog! Great stuff here!

There was a very interesting thread on sudo at linuxreality: http://www.linuxreality.com/forums/index.php?topic=268.0

This person had removed his /etc/hosts file and couldn't be root even in recovery mode. He was able to write a new hosts file using a separate recovery disk. I always like to have one on hand just in case. My favorite is Recovery Is Possible by Kent Robotti. If something happens to my partition table, for example, I'll not be able to use the recovery boot mode, but that little floppy is going to work and give me a fighting chance. It has a great help right on the floppy with tips for the forlorn. :-) I brag about it on http://linuxbasics.org/tutorials/using/help_from_recovery_is_possible
 
Hello
Costume Jewellery Watches, items on auctions & discount prices on

[url=http://auxwatches.007sites.com]cie watches[/url]
[url=http://dieselwatch.freehostking.com]citizen watch collection[/url]
[url=http://jojowatches.hostaim.com]cole watches[/url]
[url=http://watches.awardspace.us]concord watches[/url]
[url=http://watchestop.0catch.com]costume watches[/url]
 
Post a Comment

Links to this post:

Create a Link



<< Home

This page is powered by Blogger. Isn't yours?