General information
If you have lost the root user password and cannot log in, this guide will help you reset it.
To reset the password, you will need console access to the server. Go to the Customer portal → Server page → VNC Console. This provides direct access to the server's console, even if SSH is unavailable.
To reset the password:
- Reboot the server
- Edit the kernel boot parameters using the GRUB bootloader
- Boot into single-user mode
- Set a new root password without entering the previous one
- Reboot the server
The reboot
and shutdown -r
, commands, as well as the Ctrl+Alt+Del button, will not work at this stage, as they rely on the init
daemon, which will be replaced with /bin/bash
.
Use the reboot -f
command or manually start init
using exec /sbin/init
.
Resetting a password on a dedicated server
To reset the root user password, complete the following steps:
- Reboot the server
- Open the customer portal, navigate to the server page, and launch the VNC Console
- In the VNC Console toolbar, click Send CtrlAltDel to reboot the server
After the BIOS screen, the GRUB boot menu will appear
- Edit boot parameters
- Use the ↑ and ↓ arrow keys to select the boot entry for your operating system (usually
*Ubuntu
)
- Press e to edit the selected entry
- Boot into single-user mode
- Locate the line starting with
linux /vmlinuz
- Replace the
ro
parameter to rw
- At the end of the line, add
init=/bin/bash
-
- Press Ctrl+Xor F10 to boot with the modified parameters
- Use the on-screen buttons in the VNC Console to send key combinations:
The system will boot directly into a console without requiring login credentials
- Reset the root password
- Once the system boots into a shell prompt, run:
passwd root
- Enter a new root password twice when prompted
- Save changes and reboot the server
- In the console, run these commands:
sync
reboot -f
Once the system reboots, you can log in as root using the new password.
Suggested Articles
-
How to set up L2TP over IPsec for iDRAC on Linux Ubuntu 20.04
-
How to set up L2TP over IPsec for iDRAC on Linux Ubuntu 18.04