Overview
If you have lost the root password on your Vultr AlmaLinux virtual server, you can reset it using SystemRescue boot mode from the Vultr rescue ISO.
Prerequisites
- Access to the Vultr control panel to boot into rescue/recovery mode
- Root filesystem located on /dev/vda2
Step-by-Step Procedure
Step 1: Boot into SystemRescue
From your Vultr control panel, boot your virtual server into SystemRescue (rescue ISO) mode.
Step 2: Mount and Chroot into the Installed System
Run the following commands in sequence inside the SystemRescue shell:
# 1) Mount the root filesystem
mount /dev/vda2 /mnt
# 2) (Optional) Mount the EFI partition if you need to modify bootloader files
# mount /dev/vda1 /mnt/boot/efi
# 3) Bind-mount virtual filesystems into the chroot
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
# 4) Chroot into the installed system
chroot /mnt
# 5) Change the root password inside the chroot
passwd root
# 6) Exit and clean up
exit
umount /mnt/dev /mnt/proc /mnt/sys
umount /mnt
reboot
Troubleshooting
If you receive a "mount point does not exist" error, the required directories may not exist yet. Run this once before the bind mounts:
mkdir -p /mnt/dev /mnt/proc /mnt/sys
This error typically occurs when /dev/vda2 has not been mounted to /mnt yet, or the bind mount directories do not exist.
Post-Recovery
After rebooting from the Vultr rescue ISO back to the normal disk, you should be able to log in with the new root password you set.
