Introduction
In this article, we will walk you through the steps to reset a forgotten root user password on the Ubuntu 22.04
Access 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:
Under the VPS service details page click onto the button Console. Now you should have the KVM console open in a new browser

2. Reboot the machine
With the KVM console open, reboot the server to access the GRUB menu.
⚡ Note: After rebooting, quickly switch to the KVM console, as the GRUB menu is available for only a few seconds before automatically booting the operating system.
For Cloud VPS: Open the service details page and click Reboot.

For Dedicated Server: Server power control > Reboot to reboot the server.

3.Modify GRUB Boot Parameters
Once the server reboots:
- Quickly press the ESC key to bring up the GRUB menu. If you miss it, reboot the server again.
- In the GRUB menu, press E to modify boot parameters.
- On the next screen, use the arrow keys to navigate down to the line that contains
“ro quiet splash $vt_handoff
”
- Now delete and replace that with,
rw init=/bin/bash
as shown in the below screenshot - Press CTRL + X or F10 to boot into single-user mode.

4.Gain Root Shell Access Without a Password
After making the changes, Ubuntu 22.04 will boot into a shell with root privileges.
To ensure you have root access with read and write permissions, run the following command:
mount | grep -w /

You should see an output similar to:
/dev/sda5 on / type ext4 (rw, realtime)

The rw indicates that you have read and write permission
5.Reset Root and User Passwords
To reset the root password, simply run:
passwd


Enter the new password twice when prompted, and your root password will be successfully reset.