Hostxpeed
Login Get Started →
Troubleshooting

Fix "Connection Refused" SSH Error

5 min read
33 views
Jun 10, 2026

Prerequisites

Before troubleshooting:

  • Verify your server is powered on
  • Check that SSH service is installed
  • Confirm firewall rules allow port 22

What "Connection Refused" Means

This error indicates:

  • Nothing is listening on the specified port (22 by default)
  • The SSH service is not running
  • A firewall is actively rejecting the connection

Fix 1: Ensure SSH Service is Running

Via VPS console (Hostxpeed control panel > Console), check SSH status:

sudo systemctl status sshd

If stopped, start it:

sudo systemctl start sshd

Enable to auto-start on boot:

sudo systemctl enable sshd

Fix 2: Check SSH is Installed

Verify SSH package is installed:

which sshd

If not found, install it:

# Ubuntu/Debian
sudo apt install openssh-server -y

# CentOS/RHEL/Rocky
sudo yum install openssh-server -y

Fix 3: Verify SSH Port

Check if SSH is running on a custom port:

sudo netstat -tlnp | grep ssh

Or:

sudo ss -tlnp | grep ssh

If running on port 2222 instead of 22, connect with:

ssh hxroot@YOUR_SERVER_IP -p 2222

Fix 4: Firewall Blocking

Check if firewall is blocking port 22:

# For UFW (Ubuntu/Debian)
sudo ufw status

# For firewalld (CentOS/RHEL)
sudo firewall-cmd --list-all

Allow SSH:

# UFW
sudo ufw allow 22/tcp
sudo ufw reload

# Firewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload

Fix 5: Check /etc/ssh/sshd_config for ListenAddress

Ensure SSH is listening on correct interface:

sudo grep ListenAddress /etc/ssh/sshd_config

Should show:

ListenAddress 0.0.0.0

Or comment out the line entirely.

Fix 6: Out of Memory or Disk Space

Services may fail to start if server resources are exhausted:

# Check disk space
df -h

# Check memory
free -h

# Check inodes
df -i

If full, free up space or reboot.

💡 Tip: Use Hostxpeed's VNC/Console access from your control panel to troubleshoot when SSH is unavailable.

Was this article helpful?