How to Reset the Root Password on AlmaLinux VPS (ESXi Environment)
If you or a customer has forgotten the root password for an AlmaLinux VPS hosted on an ESXi environment, don’t worry. This step-by-step guide walks you through the secure method of resetting the root password using the GRUB bootloader and single-user mode. Whether you’re a system administrator or managing virtual environments for clients, this tutorial will get you back into the system with minimal downtime.
Prerequisites:
- Access to the ESXi console via vSphere Client or ESXi Host Client
- Permission to power off/on and edit GRUB settings
Step-by-Step Guide to Reset AlmaLinux Root Password on ESXi
Step 1: Access the VM Console
- Log into your ESXi host or vCenter.
- Locate the AlmaLinux VM.
- Click Console and then Launch Console.
Step 2: Reboot the VM
- If the VM is running, reboot it.
- If powered off, turn it on.
Step 3: Interrupt GRUB Boot
- As soon as the GRUB menu appears, quickly press
eto edit the boot parameters.

Step 4: Modify GRUB Parameters
- Find the line starting with
linuxorlinux16. - Use arrow keys to go to the end of that line.
- Replace the parameters
rhgb quietwith:init=/bin/bash
Example:
linux ($root)/vmlinuz-... root=... init=/bin/bash- Press Ctrl + X or F10 to boot with the modified settings.
Step 5: Remount Root Filesystem
Once in the shell prompt:
mount -o remount,rw /Step 6: Change the Root Password
passwd- Enter and confirm the new root password.
- You may see warnings like
Failed to connect to bus. These are harmless and can be ignored.

Step 7: (Optional) Relabel SELinux Context
touch /.autorelabelThis ensures SELinux applies correct labels after reboot.
Step 8: Reboot the VM
exec /sbin/initor simply:
reboot
Conclusion
You have now successfully reset the root password on an AlmaLinux VPS hosted on ESXi. This method is quick, secure, and requires no external tools. It’s a must-know procedure for any Linux system administrator managing virtualized environments.
If you found this guide helpful, feel free to share it. For more server management tips, check out our blog at eHostingServer!

