Idle SSH sessions in PuTTY can be dropped by firewalls, NAT gateways, and load balancers that “forget” quiet connections, turning a perfectly good terminal into an unexpected reconnect exercise.

PuTTY avoids idle disconnects by sending periodic keepalive traffic that does not affect the terminal session. The main control is an application-level keepalive that sends SSH “null” packets at a configured interval whenever the connection is otherwise idle.

Keepalive packets must be frequent enough to beat the network’s idle timeout, but not so frequent that they add unnecessary chatter. Keepalives also do not override every server-side policy, and they cannot prevent disconnects caused by sleep/hibernate, VPN changes, or a route that disappears mid-session.

Steps to enable SSH keepalive in PuTTY:

  1. Launch PuTTY.
  2. Select the saved session profile under Saved Sessions.
  3. Click Load.
  4. Select Connection in the Category tree.
  5. Enter 60 in Seconds between keepalives (0 to turn off).

    Increase the interval if the connection stays stable, and decrease it only when idle disconnects still occur; very small values add unnecessary traffic and can make transient network dropouts show up faster.

  6. Tick Enable TCP keepalives (SO_KEEPALIVE option).

    This option relies on operating system TCP keepalive behavior (often much longer than the SSH keepalive interval) and is typically more useful for detecting half-open connections than for preventing short idle timeouts.

  7. Select Session in the Category tree.
  8. Click Save.

    Save over Default Settings to apply keepalives to newly created sessions, or save to a named profile to keep the change scoped to that connection.

  9. Click Open.
  10. Confirm the session remains connected after staying idle longer than the previous timeout.