Sometimes it so happens that we forget root password. And even more painful thing is that when we boot in a single user mode, with a hope that it will give us a root prompt, it also asks for a password.
To get rid of this problem, do the following:
- When the GRUB prompt shows up, instead of letting it boot, select the kernel and edit it.
- At the kernel command line, instead of giving single, give init=/bin/sh. This makes the kernel to start sh instead of the actual init process. Note that parameters like single etc. should not be given because sh does not understand them resulting in a panic.
- When the root prompt shows up, give a passwd command and change the password.