Wednesday, April 11, 2007

Easy password reset in Linux (using Grub)

Another passwd reset post: link

It's being almost a year since I've finished university. Back then I've had a dual boot system on my laptop, using Linux and Windows XP 50/50 percent of the time. Since then I went for a Eurotrip with my friends and moved to Vancouver exploring numerous local mountains and the beautiful land of BC and coastal US. It's been a good four to six months before I've decided to log back into my Linux partition only to find out that I forgot the password that I have changed during one of the last exam days, when I was pushing as much of academic stuff into my head as possible. The only thing that I forgot to do is to memorize the pass. I have tried all the possible combinations that I thought I remembered, but no luck. So, I let it go deciding to come back and recover it later, when I conquer Spanish classes and some training at work that I was busy with on my spare time.

Later in the previous sentence happened to be another four or so months. I've had enough of Linux at work and didn't feel like spending more precious time at home installing something not so user friendly and adapting it (i.e. building/compiling entertainment soft) for home entertainment. I like Linux, don't get me wrong, but it's still sometimes a pain in the butt when something does not work when you need it soon and you know you can do it much faster just by rebooting back to Windows.

In any case, recently I have registered for Wireless Communications course through online program at Stanford, and began spending much more time at my home's laptop than before for obvious reasons. A quick search in the newsgroups has revealed that changing Linux's password is a matter of a few minutes! Even the learning part was trivial, requiring just a few logical steps.

I have tested this on my Ubuntu distribution. From the links below, it looks as even a fewer steps are required for SuSE.

1. Reboot the computer
2. At Grub loader's menu, select the usual line you are using for starting Linux and hit 'e' to edit it.
3. In the appeared boot steps menu, edit the line that contains kernel reference, adding 'init=/bin/bash' to it.
4. Hit Enter to finish editing the line and 'b' to boot to Bash shell.
5. Now, assuming that you don't have RW access, type the following in Bash: 'mount / -o remount,rw'.
6. Use 'passwd' to change root's password, or 'passwd lomtik' to change password for user named lomtik.
7. You are good to go. Reboot and use the newly set passwords!

Now I can say: "Esto es muy fácil!" with a smile on my face : )

2 comments:

Victor G. Lesau said...

Cheers

Anonymous said...

Who knows where to download XRumer 5.0 Palladium?
Help, please. All recommend this program to effectively advertise on the Internet, this is the best program!