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:
- Log in to the OVH Manager.
- Go to Bare Metal Cloud > Servers.
- Select your server.
- Under Rescue Mode, click … (More) > Reboot in rescue mode.
- Choose the rescue64-pro environment.
- Provide an email address to receive rescue login details.
- 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?
- If your issue persists or is outside your comfort zone, consider hiring a qualified systems administrator.
- You can refer to this cPanel guide:
Where do I find a systems administrator?
β Summary
Task | Command/Action |
---|---|
Enter Rescue Mode | OVH Panel > Reboot > Rescue |
SSH to Rescue | ssh root@<Rescue_IP> |
Mount system disk | mount /dev/sdX /mnt/recovery |
Chroot into system | chroot /mnt/recovery |
Reset root password | passwd |
Exit rescue and reboot normally | Use 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
- Log in to the OVH Cloud Manager.
- Go to Bare Metal Cloud > Dedicated Servers (or VPS).
- Select your server.
- Under Rescue Mode, click … > Reboot in rescue mode.
- 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:
- Hire a sysadmin:
https://support.cpanel.net/hc/en-us/articles/360051869814 - Or restore from a recent JetBackup or R1Soft snapshot.
β Summary Table
Task | Command or Step |
---|---|
Rescue Mode | Enable via OVH Manager |
SSH to Rescue | ssh root@<Rescue_IP> |
Mount Disk | mount /dev/sdaX /mnt/recovery |
Enter System | chroot /mnt/recovery |
Reset Password | passwd or /scripts/chpass root NEWPASS |
Fix WHM Lockout | Edit /etc/hosts.allow and /etc/hosts.deny |
Disable CSF | csf -x or touch /etc/csf/csf.disable |
Restore from WHM backup | Login to WHM once restored and restore account |