ssh port 22 Connection timed out 🐧 Linux

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

  1. Allow your current IP on port 22 in the security group/firewall
  2. Confirm the instance is running and the IP is current
  3. Try another network or SSH over 443 / a bastion

Detailed fix by platform

Shell

  1. bash
    curl -s ifconfig.me   # your current public IP for the firewall rule
    nc -vz -w5 203.0.113.10 22

How to diagnose

  1. Firewall — Rule allows your IP?
  2. Instance — Running, current IP?
  3. 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:

🧠 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.