How to restore or modify the Linux root password on a KVM VPS

For KVM based VPS, it is not possible to change the root password from the administration panel, however it is possible to do it using VNC. Please follow these instructions if you would like to change or restore your KVM VPS root password.

3- Press any key when the following message appears to enter Grub menu.

4- Press ‘e’ on your keyboard to edit the kernel boot options.

5- Highlight the second stanzas (line) and press ‘e’ again.

6- You will now be able to to edit the line highlighted in the previous step, now simply add ‘1’ at the end of the line as showed in the following screenshot and press Enter.

7- Now you should see the grub stanzas such as in step 5. Press ‘b’ to boot using the modified configuration. Now Linux will boot into single user mode, this is a special mode used for some administrative tasks (it will provide you with root access without the need to enter the root password) and can be used to restore the root password. Once the system is up and running type the following command to update the root password:

passwd root

You will be asked to introduce a new password for the root user.

Once done reboot your VPS and you will be able to use the newly created root password.