a few years ago i built a linux webserver out of an (what’s by now) 11-year old dell optiplex. the thing is rock-solid, never crashes and - fingers crossed - has been secure for the most part. anyway, i <3 my linux server, except for those one or two times a year where i *do* have to reboot it for one reason or another. i’m sure it has to do with the HD size (4GB) and age but 9 times out of 10 i’ll get a unreadable block error and then have to manually run fsck (w/ no switches) out of single-user mode. on the plus side, it only takes like 30 seconds and then i’m back up.

this morning after rebooting the web server (i had to shut it down while trying to get my air conditioner working, it’s a long story) and failing the initial bootup, the usual single user mode / root password prompt came up. however, this time my password wasn’t working.

Type control-d to proceed with normal startup,
(or give root password for system maintenance):
Login Incorrect

granted, it has been about eight months since the last time i needed my password but i don’t recall changing it either. after about 15 minutes of different combinations, i looked up tony lawrence’s article on lost root passwords; it got me in as follows:

at the LILO prompt, enter yourlinux init=/bin/bash
where yourlinux is the name of your linux installation as listed in the boot menu.

at the subsequent init prompt, enter mount -o remount,rw /dev/sda2
where sda2 is the name of the device you’re trying to mount.

then at the next prompt, enter passwd
you’ll be prompted to enter a new root password twice. then reboot.

on my first try, i did it without specifying which device (mount -o remount,rw /) to mount and after entering a new password, it told me that the password file was locked. so def skip ahead to using the full path to your hard drive.

full article here. tony, you’re totally my hero.


No Responses to “whathappenedtomypassword init=/bin/bash”  

  1. No Comments

Leave a Reply

You must log in to post a comment.