Tips and Tricks: 1

SSH Connection timeout increase on Linux VMs

The SSH protocol (also referred to as Secure Shell) is a method for secure remote login from one computer to another. It is a popular mechanism to connect Linux/Unix desktop from client machines. Keeping this connection alive is a bit of headache sometimes. Sometimes from server side, may be ssh server configuration or firewalls create issues and sometime from client side.

To avoid this issue you can you can adjust your SSH client’s or server settings.

SSH Server Setting to fix the issue -

# Open the /etc/ssh/sshd_conf on your server and updateClientAliveInterval 120
ClientAliveCountMax 720
It will keep the session for 120*720 Sec

SSH Client Settings to fix the issue -

Open PuTTY and update

Connection -> Category -> Connection -> Sending of null packets to keep session active -> Seconds between keepalives -> Type suitable value.

With this configuration, PuTTY sends a packet to the server every interval of time to keep the connection alive.


# Update ssh_configServerAliveInterval 120
ServerAliveCountMax 720

Happy Connecting !

In quest of understanding How Systems Work !

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store