SSH "Timeout, server not responding"
This line comes after the SSH connection was made, often well into a session. ssh had been sending periodic keepalive requests, enough of them went unanswered, and ssh then ended the session. The line says the probes got no reply. It does not say why the path went quiet.
This page describes standard OpenSSH behaviour. The commands are the usual ones, and wording differs between versions and platforms. We did not run them against a particular server or network for this page.
What the line looks like
Timeout, server server.example.com not responding.
Timeout, server not responding.
The first form, with the host name filled in, is the one current OpenSSH prints. Older versions print the second form without a host name. The host name in the example is only an example, and yours will differ. Both mean the same thing here.
ssh only does this when ServerAliveInterval is in use, either in
the command, with -o, or in a config file. That option makes ssh
send a request to the server at intervals and wait for a reply. When enough of
those requests in a row get no reply, ssh gives up on the connection and
prints this line. This line is not a sign that ssh found the connection
closed. It is ssh deciding, from the silence, to end it.
Several different situations look the same from the client: your own network dropped, your machine slept, something in the path stopped passing traffic, or the host stopped answering. The line cannot tell them apart.
Which page is this?
Several messages sound alike, so check what else the log shows. This page is for a session that was already open and was ended by unanswered keepalive probes.
- Connection timed out or Operation timed out comes before any session exists: the connection was never opened. Here it was, and the probes were what went unanswered.
-
Connection timed out during banner exchangeis a stall at the start, when the TCP connection opened but no identification arrived in time. The kex_exchange_identification guide covers it as a related case. - Connection closed by remote host, Connection reset by peer and Broken pipe are the ordinary lines when a session ends because the other end or the path closed it, reset it or was found broken. This page is for the line ssh prints when it ends the session itself after silence.
- The autossh guide is about a persistent tunnel that keeps dropping, and it shows how the keepalive options are used there. This page is the everyday line on its own.
1. Confirm the line and where it appeared
Check that the text matches one of the two forms above, and not a connect-time
timeout or an ordinary close line. Note when it appeared: after a long quiet
period, right after your laptop woke, after a network change, or while
something was running. To see the line in context, run the command again with
-v and keep the whole output:
ssh -v user@server.example.com
The ssh -v output reader checks a pasted log for well-known messages, including this line, and links the matching guide. It runs in your browser and sends nothing.
2. See where the keepalive setting comes from
Look for ServerAliveInterval in the command, for example in a
-o option, and in the config for that host. If you did not set
it, a config file, a shell alias or a wrapper script may have.
ssh -G server.example.com | grep -i serveralive
ssh -G prints the settings ssh would use for that host, and the
lines it shows come from the command line and the config files it reads. Do
not read this page as advice to pick a value. A suitable number depends on the
network and on what the connection is for, and we do not suggest one. For a
persistent tunnel that a device holds open, the
autossh guide shows how
the options are used. For an ordinary session that goes quiet, the
close guide
names the option in its idle check.
3. Rule out your own network, and see whether the host answers
The probes can only get through if the path works in both directions, so start on your own side. These are the same generic checks the close guide walks through, and this page does not repeat them in full.
- Did your own network drop? A Wi-Fi change, a VPN that reconnected, a sleeping laptop or a switch to mobile data can leave a session with nothing coming back, and ssh then reports the silence.
- Was the session idle? Something in the path, such as a router, a firewall or a proxy, may stop passing traffic on a connection that was quiet. This page does not say how long, because that differs from one network to the next.
- Does the host answer another way now? Open a new connection, or try from another network such as a phone hotspot. If a new connection works, the old one was lost on the path or on the host. If it does not answer at all, see the timeout guide.
If you can reach the far machine some other way, its sshd log and uptime can show whether it restarted or lost its network. That is a generic possibility, not a diagnosis.
If the machine is a RescueShell device
A path that starts from the device can help when you rely on an inbound SSH port that later goes quiet from the internet side. The agent on the device keeps an outbound HTTPS connection to our relay, so a public SSH port or a forward is not part of the path to a shell, and nothing has to be open inbound. See SSH without port forwarding. That needs the agent installed and running first.
This line is about keepalive probes on an open SSH session that got no reply. The relay does not make a far sshd answer those probes. A session that went quiet because your own network dropped, or because the device has no network of its own, is not changed by the relay. If a shell does not open once the agent is installed, see the shell does not open.
Try it on one device
The first device is free to try with no card, for 30 days from when it connects, not from when you sign up. Start a trial.