Strovent SystemsSign in
Reference

Why did my session disconnect?

How to tell why a terminal session ended, from idle timers and host sign-off to a network change, sleep, SSH keep-alives, Mosh, or a TLS handshake failure.

A session can end for several different reasons. The right next step depends on whether a screen ever appeared, whether you had been idle, and whether the network or the device changed.

If no screen ever appeared

The connection failed while it was starting. That is not the same as a drop later.

If it dropped while you were idle

Two different timers can look the same from your side.

A network device ended a quiet connection. Firewalls and NAT boxes often close a TCP session that has had no traffic for a while. On z/OS, the TN3270 server then logs EZZ6034I with reason ERR 1027 (no TCP acknowledgement), TIMEMARK (no reply to the server's "are you there" request), or CLNTDISC (the client end closed, which is also what you see when a firewall sends a reset). IBM documents that the TN3270 server does not use TCP keep-alive. It uses TIMEMARK and SCANINTERVAL instead. See EZZ6034I CONN DROP after idle, TN3270 TIMEMARK and SCANINTERVAL.

The host signed you off. These timers watch your work, not the packets that keep a firewall happy:

Some clients send keep-alive traffic so a quiet connection is less likely to be dropped by a firewall. That does not stop a host timer that watches your work. See Why a session disconnects when it sits idle.

If the network changed, or a device went to sleep

SSH and Telnet bind the session to one TCP connection. If the device changes from Wi-Fi to cellular, a VPN reconnects, or the phone, tablet or host goes to sleep, that connection is usually gone.

SSH keep-alives

OpenSSH can send alive messages inside the encrypted channel: ServerAliveInterval on the client, ClientAliveInterval on the server. If the other side does not answer after CountMax messages (the default is 3), the sender closes the session. The interval defaults to 0, which means no messages are sent.

These detect a dead connection. They cannot restore one, and they cannot stop a firewall from cutting the path. If the link is already gone, a short interval only makes the session end sooner. When the client gives up this way, it prints "Timeout, server ... not responding." See SSH keep-alives and idle timeouts.

Mosh, compared with SSH

A Mosh session is built to survive a change of IP address, a sleep, or a lost signal. The client logs in over SSH, then the session itself runs over UDP. By default mosh-server waits for the client with no time limit. A host can set MOSH_SERVER_NETWORK_TMOUT so the server exits after that many seconds with no update from the client. That is a connectivity timeout, not an idle-work timeout.

Starting Mosh again starts a new session. It does not reattach to an old mosh-server. See Mosh or SSH?, How Mosh works, How long a Mosh session lasts and You have a detached Mosh session on this server.

Getting work back

Sources

Spotted a mistake? Email [email protected].