Reset root password
This guide will show you how to reset a forgotten root password. Several methods are listed to help you accomplish this.
Using a LiveCD
With a LiveCD a couple methods are available: change root and use the passwd command, or erase the password field entry directly editing the password file. Any Linux capable LiveCD can be used, albeit to change root it must match your installed architecture type. Here we only describe how to reset your password with chroot, since manual editing the password file is significantly more risky.
Change root
- Boot the LiveCD and mount the root partition of your main system.
- Enter the chroot session.
-  Use the passwdcommand to set the new password (you won't be prompted for an old one).
- Exit chroot session.
- Unmount the root partition.
- Reboot, and enter your new password. If you can't remember it, go to step 1.
Using GRUB to invoke bash
-  Select the appropriate boot entry in the GRUB menu and press eto edit the line.
-  Select the kernel line and press eagain to edit it.
-  Append init=/bin/bashat the end of line.
-  Press bto boot (this change is only temporary and will not be saved to your menu.lst). After booting you will be at the bash prompt.
-  Your root file system is mounted as readonly now, so remount it as read/write mount -n -o remount,rw /.
-  Use the passwdcommand to create a new root password.
- Reboot and do not lose your password again!
See also
- this guide for an example.