If you face SSH proxy sessions that frequently drop, an important setting to check in SSH clients like Putty or MobaXterm is “keepalive”. Adjusting this setting correctly can help maintain connection stability and prevent unexpected drops.
Understanding and Configuring Keepalive:
- Keepalive Function:
- The keepalive feature sends null packets or “heartbeats” to the server at regular intervals to keep the connection alive. This is useful for preventing session timeouts that can occur if a connection is idle for an extended period of time.
- Checking the Keepalive Configuration:
-
Access the settings of your SSH tool, whether Putty or MobaXterm.
-
Navigate to the connection options and locate the keepalive setting.
-
In Putty, this option is usually found under “Connection → Seconds between keepalives”, and should be set to a non-zero number to enable keepalive.
-
Moba
- Recommended Keepalive Value:
- An appropriate keepalive value depends on the network environment and the policies of the server you are connecting to. A common range is 60 seconds, but you may need to adjust this based on your specific network requirements.
- Effect of Zero Value:
- If the set keepalive value is zero, the keepalive feature is disabled. This can lead to disconnections if the session remains idle for periods that exceed the server timeout limits.
- Tuning and Testing:
- Set keepalive to an appropriate value and save the settings. Test the SSH session to see if the connection stability has improved. Monitor whether these adjustments reduce or eliminate disconnections.