What the message looks like
ssh: connect to host 203.0.113.10 port 22: Connection timed outCommon causes
- A firewall or cloud security group drops port 22.
- Wrong IP address or hostname, or DNS points to an old server.
- The server is down, frozen or has lost its network.
- SSH listens on another port, or only on a different interface.
- Your IP was banned by fail2ban or a similar tool, or your network blocks outgoing port 22.
Check
- See where the connection stops
ssh -v user@server.example.com - Is the port reachable? (5 second timeout)
nc -vz -w 5 server.example.com 22 - Does the name resolve to the address you expect?
- On the server (via console): is SSH listening?
ss -ltnp | grep sshd
Fix
- Open the port in the firewall:
ufw allow 22/tcp, or in the cloud provider's security group. - Use the right port if you changed it:
ssh -p 2222 user@host. - If fail2ban banned you, unban the address:
fail2ban-client set sshd unbanip 198.51.100.7. - Check the server in the provider's console: is it running, does it have network?
- Try from another network (a mobile hotspot) to rule out a block on your side.
FAQ
What is the difference between timed out and refused?
Timed out means no answer came back, typically a firewall that silently drops the traffic, or a machine that is down. Refused means the machine answered and said nothing is listening on that port.
Could this be a brute-force protection?
Yes. After several failed logins, tools like fail2ban block your address. Check the jail status from the server console.