On system bootup you you will see the GRUB loading screen:
http://img705.imageshack.us/img705/6326/pic1za.pngSelect the option to boot normally and press "e"to edit the boot options:
http://img26.imageshack.us/img26/1406/pic2sr.pngThen you select the kernel and press "e" to edit
http://img440.imageshack.us/img440/5513/pic3dm.pngRemove any other boot stuff in plus(quiet, splash ) and add "single init=/bin/bash"(bash, sh, csh, etc) at the end, and press ENTER.
http://img38.imageshack.us/img38/8056/pic4ig.pngThen press "b" to boot:
http://img444.imageshack.us/img444/1821/pic5e.pngWhen you get to root@bash#, you have root access to the system but in read only mode so you will have to remount the drive as read and write
- Code: Select all
mount -n -o remount,rw /
Make a copy of /etc/shadow and /etc/passwd
- Code: Select all
cp /etc/shadow /etc/shadow.bak
cp /etc/passwd /etc/passwd.bak
Then you can change pass word by calling passwd
- Code: Select all
passwd root
Reboot, let it load normally, All done
For lilo its much easier:
- Code: Select all
boot:Linux init=/bin/bash
And do the steps above when you get to root@bash#