How to recover the root password in Linux

For resetting the lost root password, boot the system to "Single User Mode" and simply issue the "passwd" command. In Single User Mode, the system will boot to "runlevel 1" and the local file systems will be mounted, but network interfaces will not be activated. Also in this mode, we can access to shell prompt and reset the root password.

This tutorial explains the detailed steps to reset the lost root password via Single User Mode.

To access Single User Mode, we need to boot the system to the "GRUB" bootloader menu screen.

When the system starts to boot, we need to press the "Escape" key to access the GRUB menu screen.

Then hiighlight the operating system using the arrow keys and press "e" to edit.

Once pressed "e", we will be taken to the end of the line. Then press the "space" key and then add the number "1" to the end of the line.

Now press "Enter" to save the entry.

Press "b" to boot the system and it will be boot into "Single User Mode" now.

We will get the command prompt and can issue the command "passwd" to change the root account password.

Reboot your system by issuing the "reboot" command.

The system will now reboot normally back to its normal runlevel.

That's all.........

Leave a Reply