Recovery of root password on Debian 10

  • Support
  • Recovery of root password on Debian 10
Estimated reading time: 2 min

Introduction

In this article, we will learn how to recover the password of the root user account on the Debian 10 operating system.

Debian 10 password recovery logo

Prerequisites

Recovery of root password

Step 1: Log into the KVM console

In order to change the root password you will need to log into the KVM console, depending on which server type you are using the methods may differ.

If you are using Cloud VPS please refer to this article

If you are using a dedicated server with iDRAC please refer to this article

If you are using a Supermicro servers please refer to this article

For VPS users navigate to under the VPS service details page, from there you can click Console, this will open the kvm console on a new browser.

Step 2: Reboot the machine

While you have your KVM console open, reboot the server to get the GRUB menu.

Dedicated server users will have to open Server Power Control

right after that click reboot to restart your server.

VPS users: Open the service details page of the VPS and click on the reboot button

Note: After rebooting your server quickly go to the KVM console as GRUB menu waits only a few seconds before booting OS.

Step 3: Modify boot parameters

After rebooting the VM quickly switch to KVM console and keep pressing the ESC.

You will need to do this very quickly to get the GRUB menu.

 Note: If you missed the grub screen, go ahead and reboot your server again.

In GRUB menu, press E to edit the GRUB parameters

In GRUB edit mode, find the line which starts with linux /boot/ , next you will need to navigate to the end which should show ro quiet , add a space and type the following:

init=/bin/bash

it should look like this:

linux          /boot/vmlinuz-4-19.0-8-amd64 root=UUID=c0e7e71a-f8a6-4005-9925-1ca5f3455d1 ro  quiet init=/bin/bash

Once done, press CTRL + X or F10 to boot in single-user mode.

Step 4: Reset password

Next you will need to change the acces right from read-only to read-write, to do so type the following command:

mount -o remount, rw /

Now we can change the root password, run the following command to change your password:

passwd

to change your password.

After that you can reboot the server with the following command:

reboot -f

 Conclusion

In this tutorial we have shown how to recover the root password for Debian 10

Was this article helpful?
Dislike 1
Views: 6998

Reader Interactions

Leave a Reply

Your email address will not be published. Required fields are marked *