SFTP connection refused
What “connection refused” means for SFTP and how to fix port/service/firewall issues quickly.
Diagnose this automatically
Test whether the network port is reachable before investigating authentication problems.
Shareable output
Prefer the browser? Run the same check on the homepage.
“Connection refused” means the host is reachable, but nothing is accepting connections on the target port.
This is almost always service-down, firewall/allowlist, or the wrong port.
Common causes
- SSH/SFTP service not running on the server
- Wrong port (SFTP is commonly 22, but not always)
- Firewall/security group blocking inbound connections
- Server allowlist blocks your source IP
Fixes to try
- Confirm the port with the vendor/admin.
- From a machine in the same network, test TCP connectivity to host:port.
- Verify sshd is running and listening on the expected port.
- Check firewall rules/security group and allowlist the source IP.
Quick commands
nc -vz <host> 22
telnet <host> 22
ssh -vvv <user>@<host> -p 22Related
- 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.
- TCP connection timeout (firewall issue) — Why FTP/SFTP connections time out and how to diagnose firewall, routing, or allowlist blocking.
Diagnostics powered by FTPMonitor CLI