Restore your SSH access using WHM Autofixer
If you are locked out of your server and cannot connect via SSH, the WHM Autofixer tool can help you restore access without requiring a reboot or console login. This is particularly useful when a misconfigured SSH daemon or firewall rule is blocking your connection.
Using WHM Autofixer to Restore SSH
The WHM Autofixer is accessible through your web browser even when SSH is unavailable. Follow these steps to restore SSH access:
- Open your browser and navigate to the WHM Autofixer URL:
https://HOSTNAME:2087/scripts2/autofixer
ReplaceHOSTNAMEwith your server's IP address or hostname. - Log in to WHM with your root credentials.
- In the Autofixer input field, type the following command:
safesshrestart - Click the Submit button.
- WHM will restore your SSH configuration to a known-good state and restart the SSH daemon (
sshd).
What safesshrestart Does
The safesshrestart Autofixer action performs the following operations:
- Checks the current SSH configuration file (
/etc/ssh/sshd_config) for syntax errors. - Restores any problematic configuration values to safe defaults.
- Restarts the SSH service so that the corrected configuration takes effect.
After the restart, try connecting to your server via SSH again. If access is still blocked, the issue may be related to your firewall. In that case, you can use WHM to check and restart your firewall service as well.