ssh: connect to host x port 22: Connection timed out
SSH packets get no reply — a firewall/security group drops them, the server is off, or the IP is wrong.
Seen on:
Linux
Meaning
Timeouts (unlike “refused”) mean nothing answered. Cloud security groups/NSGs not allowing your IP, a changed public IP after reboot, or a host that is down are the usual causes.
Common causes
- Cloud firewall/security group doesn’t allow port 22 from your IP
- Server stopped or its public IP changed
- Local network blocks outbound 22 (corporate/hotel Wi-Fi)
- Host firewall DROP rule
⚡ Quick fix
- Allow your current IP on port 22 in the security group/firewall
- Confirm the instance is running and the IP is current
- Try another network or SSH over 443 / a bastion
Detailed fix by platform
Shell
- bash
curl -s ifconfig.me # your current public IP for the firewall rule nc -vz -w5 203.0.113.10 22
How to diagnose
- Firewall — Rule allows your IP?
- Instance — Running, current IP?
- Network — Works from another network?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in Linux
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026