πŸ”§ How to Regain Access to an OVH Server via Rescue Mode

Here is a guide based on the referenced article and OVH procedures:

If you’re unable to SSH into your OVH server as root, you can regain access using Rescue Mode, which allows you to boot into a recovery environment and manually fix issues such as networking problems, SSH misconfiguration, or a forgotten root password.

πŸ’‘ Note: OVH provides the infrastructure, but you are responsible for server-level troubleshooting. If using cPanel, remember that cPanel support does not handle server or network issues outside its software scope.


πŸ“Œ Scenarios for Rescue Mode Usage

  • Lost or corrupted SSH access (e.g., broken config, key issues)
  • Forgotten root password
  • Misconfigured firewall or network rules
  • Full / partition preventing logins
  • Kernel issues or system not booting properly

πŸš€ Step-by-Step Procedure

πŸ”Ή 1. Boot into Rescue Mode

For OVH Dedicated Servers:

  1. Log in to the OVH Manager.
  2. Go to Bare Metal Cloud > Servers.
  3. Select your server.
  4. Under Rescue Mode, click … (More) > Reboot in rescue mode.
  5. Choose the rescue64-pro environment.
  6. Provide an email address to receive rescue login details.
  7. Click Confirm and Reboot the server.

For OVH VPS:

Refer to:
How to Recover your OVH VPS in Rescue Mode


πŸ”Ή 2. Access the Server via SSH

Once rescue mode is active, OVH will email you credentials:

  • Username: root
  • Temporary password
  • Rescue IP

Connect using SSH:

ssh root@<Rescue_IP>

πŸ”Ή 3. Mount the System Disk

Find your system disk:

lsblk

Example output:

sda      8:0    0   100G  0 disk
└─sda1   8:1    0   100G  0 part

Mount the root filesystem:

mkdir /mnt/recovery
mount /dev/sda1 /mnt/recovery

Also mount dev, proc, and sys for a full chroot:

mount -o bind /dev /mnt/recovery/dev
mount -o bind /proc /mnt/recovery/proc
mount -o bind /sys /mnt/recovery/sys

πŸ”Ή 4. Chroot into the System

chroot /mnt/recovery

Now you’re inside the original system as root.


πŸ”Ή 5. Perform Recovery Tasks

You can now:

  • Reset the root password: passwd
  • Fix SSH Configuration (e.g., /etc/ssh/sshd_config)
  • Disable firewall rules: systemctl disable firewalld
  • Check system logs: journalctl -xe tail -n 100 /var/log/messages
  • Uninstall problematic services or updates
  • Free up disk space, if full: du -sh /* | sort -h

πŸ”Ή 6. Exit & Reboot to Normal Mode

Exit the chroot and unmount the partitions:

exit
umount /mnt/recovery/dev
umount /mnt/recovery/proc
umount /mnt/recovery/sys
umount /mnt/recovery

Go back to the OVH control panel and reboot into normal mode.


🧠 Need More Help?


βœ… Summary

TaskCommand/Action
Enter Rescue ModeOVH Panel > Reboot > Rescue
SSH to Rescuessh root@<Rescue_IP>
Mount system diskmount /dev/sdX /mnt/recovery
Chroot into systemchroot /mnt/recovery
Reset root passwordpasswd
Exit rescue and reboot normallyUse OVH panel to boot from disk

Here’s a tailored version of the guide specifically for cPanel servers hosted on OVH, showing how to regain access via Rescue Mode, especially if you’re locked out of root SSH or WHM.


πŸ” Regain Access to an OVH cPanel Server via Rescue Mode

If your cPanel server hosted at OVH is no longer accessible (due to firewall misconfiguration, root password issues, or SSH errors), you can use Rescue Mode to repair the system, reset the root password, or regain access to WHM.


🧭 When to Use This

  • Lost SSH root access
  • Can’t log in to WHM (root credentials rejected)
  • IP blocked by firewall
  • Disk is full, or OS won’t boot
  • SSH config or PAM misconfiguration

βš™οΈ Step-by-Step for cPanel Servers

πŸ”Ή 1. Enable Rescue Mode in OVH Panel

  1. Log in to the OVH Cloud Manager.
  2. Go to Bare Metal Cloud > Dedicated Servers (or VPS).
  3. Select your server.
  4. Under Rescue Mode, click … > Reboot in rescue mode.
  5. Select rescue64-pro, provide an email address, and reboot.

βœ… OVH will email you SSH access credentials for the temporary rescue environment.


πŸ”Ή 2. SSH into Rescue Mode

Use the credentials provided in the email:

ssh root@<Rescue_IP>

πŸ”Ή 3. Mount the Real Filesystem

List the available disks:

lsblk

Create a mount point and mount the root partition (e.g., /dev/sda2):

mkdir /mnt/recovery
mount /dev/sda2 /mnt/recovery

Then mount dev, proc, and sys:

mount --bind /dev /mnt/recovery/dev
mount --bind /proc /mnt/recovery/proc
mount --bind /sys /mnt/recovery/sys

πŸ”Ή 4. Enter the System (Chroot)

chroot /mnt/recovery

You are now operating within your actual cPanel system.


πŸ”Ή 5. Reset the Root Password

If you can’t access WHM or SSH due to bad credentials:

passwd

Enter a new strong password.


πŸ”Ή 6. Disable Host Access Control (if locked out of WHM)

If you accidentally blocked yourself using WHM’s “Host Access Control” feature:

nano /etc/hosts.allow

Comment out or remove any deny/allow entries that restrict your IP.

Also check /etc/hosts.deny.


πŸ”Ή 7. Fix SSH Configuration (if broken)

If SSH was misconfigured:

nano /etc/ssh/sshd_config

Restore default settings if needed, then:

systemctl restart sshd

Or, if in chroot and services aren’t available:

Just edit the config, and SSH will work after reboot.


πŸ”Ή 8. Free Up Disk Space (if full)

If you were locked out due to a full disk:

du -sh /var/* | sort -h

You can clear:

rm -rf /var/log/*gz
rm -rf /var/lib/mysql/mysql-bin.*

⚠️ Be cautious when deleting dataβ€”avoid removing critical service files.


πŸ”Ή 9. Exit and Reboot to Normal Mode

Exit chroot:

exit

Unmount all filesystems:

umount /mnt/recovery/dev
umount /mnt/recovery/proc
umount /mnt/recovery/sys
umount /mnt/recovery

Go back to OVH panel and reboot into normal mode (from local disk).


πŸ§ͺ Extra Tips for cPanel

Reset WHM Password via Script

In chroot, run:

/scripts/chpass root NEWPASSWORD

This ensures cPanel/WHM password is synced with the system root password.

Disable CSF Firewall Temporarily

If you’re blocked by CSF, disable it:

csf -x

Or prevent it from starting at boot:

touch /etc/csf/csf.disable

πŸ†˜ Need Help?

If you’re still unable to fix the issue:


βœ… Summary Table

TaskCommand or Step
Rescue ModeEnable via OVH Manager
SSH to Rescuessh root@<Rescue_IP>
Mount Diskmount /dev/sdaX /mnt/recovery
Enter Systemchroot /mnt/recovery
Reset Passwordpasswd or /scripts/chpass root NEWPASS
Fix WHM LockoutEdit /etc/hosts.allow and /etc/hosts.deny
Disable CSFcsf -x or touch /etc/csf/csf.disable
Restore from WHM backupLogin to WHM once restored and restore account
Scroll to Top