Once in a lifetime you might forget your root password. If that happens, reboot your distro and at the GRUB prompt press “e” to edit the first line. Make sure the new entry sais “linux single”. Press “b” to boot the new entry line. You’ll be thrown into single user mode and given a BASH prompt. Do a
Now see that line that sais
somewhere at the top of the file? Make it look like
by deleting the “x” between the two “:“. Save the file. Now open up the shadow file in nano:
Make the first line look like this:
by deleting every encrypted password. Save.
Reboot and log in as a normal user, then set a new root password: