FTPMonitor / Errors / ECONNREFUSED on port 22

ECONNREFUSED on port 22

Meaning of ECONNREFUSED for SFTP/SSH on port 22 and the fastest ways to isolate firewall vs service vs wrong port.

ECONNREFUSED means the TCP handshake was rejected. The host is up, but the port is closed or blocked.

Common causes

  • SSH/SFTP service not running
  • SSH is on a non-standard port (not 22)
  • Firewall/device rejects connections to port 22

Fix checklist

  1. Confirm SSH is listening on port 22 (or the configured port).
  2. Verify inbound firewall rules allow your source IP.
  3. If the server is internal-only, run checks from inside the network/VPN.

Quick commands

nc -vz <host> 22
ssh -vvv <user>@<host> -p 22
Related
Diagnostics powered by FTPMonitor CLI