Linux

How to keep the SSH connection active

By Lucas
August 20, 2018
1 min min read
How to keep the SSH connection active

When making an SSH connection on Linux, after a few minutes of inactivity, the connection is lost. In this tutorial, we’ll teach you how to keep an SSH connection alive on Linux.

We will edit the “/etc/ssh/ssh_config” file :

nano /etc/ssh/ssh_config

Then simply “uncomment” or add the following lines:

Host *
ServerAliveInterval 30
ServerAliveCountMax 2

Restart the SSH Client:

service ssh restart

Related Articles