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.
Related: How to enable SSH client keepalive
Related: How to enable SSH compression in PuTTY
Steps to enable SSH keepalive in PuTTY:
- Launch PuTTY.

- Select the saved session profile under Saved Sessions.

- Click Load.

- Select Connection in the Category tree.

- 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.
- 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.
- Select Session in the Category tree.

- 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.
- Click Open.

- Confirm the session remains connected after staying idle longer than the previous timeout.

Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.
