Monday, August 31, 2009

How to reset forgotten root password in Debian

1. On grub-boot prompt. press e to enter the edit mode.

2. Press down arrow to reach the line that starts with kernel and press e again.

3. At the end of this line type in init=/bin/sh.

4. Then press enter to save that change and press b to boot, in a few seconds you will be on your # prompt

5. Remount the root file system in read-write mode.

mount -o remount rw /

6. Finally type passwd command to change the password.

7. Reboot and login with the new password.