> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Fix "SSH Connection Timed Out"

> Fix "ssh: connect to host port 22: Connection timed out": check the server runs, the IP is right, the firewall allows SSH and your network doesn't block it.

"Connection timed out" means your SSH client got no answer at all from that IP and port. The server is off or not booted, the IP is wrong, a firewall silently drops the traffic, the server's network settings are broken, or your own network blocks the port. Check the server's status in the VPS Panel, test the port with `nc -vz -w 5 203.0.113.10 22`, then fix the firewall or network from the VNC console.

```text theme={null}
ssh: connect to host 203.0.113.10 port 22: Connection timed out
```

On macOS the same problem reads `Operation timed out`.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Beginner | 5 to 20 minutes | Ubuntu 22.04 / 24.04, Debian 12 / 13, AlmaLinux and Rocky Linux 9 / 10 | Console access, root or sudo |

## Before you start

* A timeout gives no clue on its own. Work through the causes in order: the first ones take seconds to rule out.
* For fixes inside the server, use the [VNC console](https://help.freakhosting.com/portals/vps-panel/how-to-enable-and-use-vnc-console-access.md) on a VPS. On a dedicated server, [open a ticket](https://freakhosting.com/clientarea/submitticket.php) for KVM/IPMI access.
* If the message says `Connection refused` instead, see [SSH connection refused](https://help.freakhosting.com/portals/other/how-to-fix-ssh-connection-refused.md).
* Commands use `sudo`. As root, leave it out.

## Cause 1: The server is off, stuck or still booting

**Check:** open your server in the VPS Panel and look at its status. Then open the VNC console: a login prompt means the system is up; a boot error or a blank screen means it isn't.

**Fix:** [boot or restart the server](https://help.freakhosting.com/portals/vps-panel/how-to-start-stop-restart-and-power-off-your-vps.md). If it stops at an error, see [Linux server won't boot](https://help.freakhosting.com/portals/other/how-to-fix-a-linux-server-that-wont-boot.md).

## Cause 2: Wrong IP address or port

**Check:** compare the IP in your command with the one on your [server page](https://help.freakhosting.com/portals/vps-panel/a-tour-of-your-server-page.md). If you connect by domain, see which IP it resolves to:

```bash theme={null}
ping -c 3 example.com
```

**Fix:** connect by IP, and add `-p` if you [changed the SSH port](https://help.freakhosting.com/portals/other/how-to-change-the-ssh-port.md):

```bash theme={null}
ssh -p 2222 alex@203.0.113.10
```

## Cause 3: A firewall drops SSH

A firewall decides which network connections reach your server. A rule that **drops** traffic causes a timeout. UFW's default policy drops everything you haven't allowed, so `ufw enable` without an SSH rule gives exactly this error.

**Check** on the console:

> [tab] Ubuntu / Debian (UFW)
>
> ```bash theme={null}
> sudo ufw status verbose
> ```
>
> Your SSH port (`22/tcp`, `OpenSSH` or your custom port) must be listed as `ALLOW IN`.

> [tab] AlmaLinux / Rocky (firewalld)
>
> ```bash theme={null}
> sudo firewall-cmd --list-all
> ```
>
> `ssh` must appear under `services`, or your custom port under `ports`.

**Fix:** allow SSH:

> [tab] Ubuntu / Debian (UFW)
>
> ```bash theme={null}
> sudo ufw allow OpenSSH
> ```

> [tab] AlmaLinux / Rocky (firewalld)
>
> ```bash theme={null}
> sudo firewall-cmd --permanent --add-service=ssh
> sudo firewall-cmd --reload
> ```

If you use our [Firewall panel](https://help.freakhosting.com/portals/firewall/firewall-panel-overview.md), check that its rules allow your SSH port too. Full recovery steps are in [locked out after a firewall change](https://help.freakhosting.com/portals/other/how-to-fix-locked-out-after-firewall-change.md).

## Cause 4: The server's network settings are broken

After an edit to Netplan, NetworkManager or `/etc/network/interfaces`, the server may have no working IP or route. Then nothing reaches it: not SSH, not ping, not your website.

**Check** on the console:

```bash theme={null}
ip -br address
ip route
ping -c 3 1.1.1.1
```

You should see your public IP on the network interface (for example `eth0` or `ens3`) and a `default via` route. If either is missing, or the ping fails, the network is down.

**Fix:** undo your last change and apply it again (`sudo netplan apply` on Ubuntu, `sudo nmcli connection up "System eth0"` on AlmaLinux/Rocky; your connection name may differ). Compare your settings with the [network settings in the panel](https://help.freakhosting.com/portals/vps-panel/how-to-view-and-manage-network-settings.md) and see [configure a static IP with Netplan](https://help.freakhosting.com/portals/other/how-to-configure-a-static-ip-with-netplan.md).

## Cause 5: Your own network blocks the port

Office, school, hotel and some public Wi-Fi networks block outgoing SSH, especially on ports other than 22.

**Check** from your computer:

> [tab] Linux / macOS
>
> ```bash theme={null}
> nc -vz -w 5 203.0.113.10 22
> ```
>
> ```text theme={null}
> nc: connect to 203.0.113.10 port 22 (tcp) timed out: Operation now in progress
> ```

> [tab] Windows (PowerShell)
>
> ```powershell theme={null}
> Test-NetConnection 203.0.113.10 -Port 22
> ```
>
> `TcpTestSucceeded : False` means the port isn't reachable from where you are.

**Fix:** try the same command from another network, such as your phone's hotspot. If it works there, your local network is the block. Ask its administrator, or use a different network.

## How to check it worked

```bash theme={null}
ssh -v -o ConnectTimeout=10 alex@203.0.113.10
```

`debug1: Connection established.` means the network path is open. Any error after that is about the login, not the connection.

## Frequently asked questions

### Ping works but SSH times out. Why?

The server is online, so a firewall drops the SSH port, or SSH listens on another port. Check Cause 3 and `sudo ss -tlnp` on the console.

### Ping doesn't work but the server is fine. Is that a problem?

Not necessarily. Some firewalls block ping (ICMP). Test the SSH port itself with `nc` or `Test-NetConnection` instead.

### SSH times out only sometimes. What does that mean?

Intermittent timeouts point to packet loss or an overloaded server. Run [mtr](https://help.freakhosting.com/portals/other/how-to-run-mtr-and-traceroute.md) to your server and check its load with [htop](https://help.freakhosting.com/portals/other/how-to-monitor-server-resources-with-htop.md).

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every guide in this section.

> [card] [Locked out after a firewall change](https://help.freakhosting.com/portals/other/how-to-fix-locked-out-after-firewall-change.md)
>
> Recover from a rule that blocks SSH.

> [card] [Check if a port is open from outside](https://help.freakhosting.com/portals/other/how-to-check-if-a-port-is-open-from-outside.md)
>
> Test any port from the internet.

> [card] [Diagnose network latency](https://help.freakhosting.com/portals/other/how-to-diagnose-network-latency-issues.md)
>
> Find packet loss and slow routes.

> [card] [SSH connection refused](https://help.freakhosting.com/portals/other/how-to-fix-ssh-connection-refused.md)
>
> When the server answers "no".

***

> [!NOTE]
>
> **Checked against the official [OpenSSH ssh manual](https://man.openbsd.org/ssh), [Ubuntu's firewall documentation](https://ubuntu.com/server/docs/how-to/security/firewalls/) and Microsoft's [Test-NetConnection reference](https://learn.microsoft.com/en-us/powershell/module/nettcpip/test-netconnection)** on 4 November 2026; the `ssh` and `nc` timeout messages and the UFW rule (dry run) were tested on Ubuntu 24.04 LTS. The firewalld, NetworkManager and Windows commands were not tested.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.