Configure SSH client to keep connection alive in Linux

To keep SSH connection alive you must edit your ~/.ssh/config file (if the file does not exist create it) and enter the following on top of the file:

Host *
ServerAliveInterval 60

First line applies this config to all hosts (*), and the second one is interval when to send keepalive packets in seconds (60).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.