Sure! Here’s a polished step-by-step guide you can use:
If you’ve lost or forgotten your root password (or just want to reset it) on an OVH VPS or Cloud server, you can do so by booting into Rescue Mode and following these steps:
1️⃣ Boot into Rescue Mode
- Log in to the OVH Manager.
- Go to your VPS details, select Rescue Mode, and reboot the server.
- OVH will send you temporary Rescue credentials via email (usually SSH login details).
2️⃣ Mount the Filesystem
After logging in to your server in Rescue Mode via SSH, you need to mount your server’s disk.
First, identify the correct device name with:
lsblk
Look for your main disk (often /dev/vda1
, /dev/sda1
, or similar). Replace /dev/DRIVEID
below with the correct device.
Mount the filesystem to /mnt
:
mount /dev/DRIVEID /mnt
Example:
mount /dev/vda1 /mnt
3️⃣ chroot into the Mounted Filesystem
Change root into your mounted filesystem so you can operate as if you’re inside your normal system environment:
chroot /mnt
4️⃣ Change the Password
Now you can set a new root password by running:
passwd
Enter and confirm your new password when prompted.
5️⃣ Reboot to Normal Mode
Exit the chroot:
exit
Then unmount the filesystem:
umount /mnt
Finally, reboot your server from the OVH Manager, switching the boot mode back to Normal Mode.
✅ Done!
You can now log in to your VPS using SSH with the new root password you just set.