Overview
SSH (Secure Shell) is the primary method for remote administration of Linux-based dedicated servers. When SSH access fails, it can be due to network issues, firewall rules, configuration errors, or service outages. This guide walks you through a structured process to identify and resolve SSH connection problems.
Step 1: Confirm SSH Client Basics
Before investigating the server:
-
Ensure you're using the correct IP address or hostname.
-
Verify the SSH port (default is
22; custom ports should be noted). -
Test basic connectivity:
If ping fails, skip to Step 4.
Step 2: Use Verbose SSH Output
Use the -v flag to gain more insight:
Look for errors like:
-
Connection timed out: likely network/firewall issue -
Connection refused: SSH service might not be running -
Permission denied: wrong credentials or key
Step 3: Check Local Firewall and Network
Make sure outbound SSH connections are allowed:
-
Disable any VPN or proxy that might interfere.
-
On Windows, ensure port 22 isn’t blocked by local firewall software.
Step 4: Use a Web-Based Console (If Available)
If your hosting control panel (like IPMI, iDRAC, or iLO) offers KVM access, use it to:
-
Check if the server is up.
-
Restart the
sshdservice if needed:
Step 5: Verify SSH Service and Configuration
Log in locally or via KVM and check:
Also verify /etc/ssh/sshd_config:
-
Confirm
Port,PermitRootLogin, andPasswordAuthenticationsettings. -
After changes:
Step 6: Inspect Firewall Rules
Use these commands to review and adjust:
Make sure port 22 (or custom SSH port) is allowed.
Step 7: Check for Brute Force Protection or Blocking
Your server may be using tools like fail2ban or CSF. These may temporarily block your IP:
-
Check the ban list.
-
Whitelist your IP manually.
Still Not Working?
If you’ve exhausted the above steps:
-
Reboot the server via control panel.
-
Contact support with your server IP and error logs.