If you have forgotten the root password of your Linux system, there's no need to panic! The fix is quite simple. Reboot you system. At the GRUB graphical menu, press E to edit and add the following parameters to the kernel argument: Here, by appending the init=/bin/bash argument to the kernel line, we are telling Linux to immediately enter a bash prompt after booting the kernel. You can now reset the root password using the passwd command, as follows.

Name:  Forgot your root password.jpg
Views: 37
Size:  5.5 KB

Now, you may wonder that if it's so simple to reset the root password, then ordinary users can use this feature to their own advantage. The next section deals with how to password protect GRUB, so that unauthorised users can't reset root passwords.