What if regular user can’t remember his/her password, superuser can reset the password for the regular user right from the terminal. But what if the superuser loses his/her password? The following steps will guide you how to recover/reset the Root (super user) password.
1. First you need to power on or reboot the machine and access the GRUB menu. This can be done by holding down the Shift key as the computer is first booting up.
2. Select the “*Advanced options for GNU/Linux” option by pressing the down arrow key and Enter button. press e on your keyboard to edit the commands and look for the line that begins with linux /boot/vmlinuz.
3. Delete the last part of the line “ro quiet splash $vt_handoff” and replace it with rw init=/bin/bash. This will enable read-write permissions.
4. Press the F10 key to save the changes and reboot your system. You will be brought back into a bash prompt, but only on this first reboot.
5. type # mount -n -o remount , rw / then Enter the usual passwd command to set a new root password.
6. Execute the following command to reboot the system and load into the operating system like usual. # exec /sbin/init.