Choose language

Portal Home > Knowledgebase > How-to > Dedicated servers > How to recover the root password on linux

How to recover the root password on linux

To recover the root password you need to use the rescue mode, below you can find URL to the article about the rescue mode:

Rescue mode

When you have switched the server into the rescue mode and logged into it via SSH, you need to mount and chroot your root "/" partition. In our example it is sda3 partition:

mount /dev/sda3 /mnt

Now chroot it with the following command:

chroot /mnt /bin/bash

When you mount the root partition and chroot it, you must only type the command to change the password:


Type the new password twice. Now you can switch the server into the normal boot by reboot the server. When the server is online after a restart, in the normal boot you will be able to use the new password.

Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
IPMI - Remote management (Views: 8538)

Powered by WHMCompleteSolution