Typically, if you forget your VPS password, you can reset it via the Rescue tab in the server control panel. However, if you set up the server using a custom ISO file (instead of using the Rebuild function), the Rescue feature will not work. In this case, you need to reset the password by mounting a rescue ISO file. Please follow this instruction to reset your password via Rescue Iso.
-
Boot into Rescue Mode:
-
Mount the rescue ISO:
You can search for the Rescue ISO file from the ISOs tab in your VPS control panel, click Mount.

-
Reboot the VPS. Connect to the rescue system via the console function (VNC, Spice) on your VPS panel. Choose the default option in the Boot System Rescue. (Noted: You can not copy and paste in the console session.)

-
-
Locate the Root Disk Partition
-
Identify your primary operating system partition. Run:
lsblk -
Look for your main system partition (typically /dev/sda1, /dev/vda1, or an LVM volume like /dev/mapper/...).

-
-
Mount the System Partition:
Create a temporary directory and mount your main filesystem to it:
mkdir /mnt/sysmount /dev/sda1 /mnt/sys(Replace /dev/sda1 with your actual partition name).
-
Mount Virtual Filesystems & Chroot:
Mount the necessary API filesystems so system commands work properly inside the environment, then change the root directory:
for dir in /dev /dev/pts /proc /sys /run; do mount --bind $dir /mnt/sys$dir; donechroot /mnt/sys -
Reset the Password:
-
Run the standard password reset tool inside the chroot environment:
passwd root -
Enter your new password twice when prompted.
-
-
Handle SELinux (Required for CentOS/RHEL/Rocky/AlmaLinux)
-
Skip this step if using Ubuntu or Debian
-
If your VPS runs an RHEL-based distribution, trigger an automatic filesystem relabel on the next boot:
touch /.autorelabel
-
-
Exit and Unmount
Exit the chroot shell, unmount the directories cleanly, and reboot:
exitumount -R /mnt/sysreboot -
Disable Rescue Mode:
Unmount the Rescue ISO file and reboot your VPS so the VPS boots normally back into the main OS
