Master da Web
Back to Blog

How to keep the SSH connection active

LucasAugust 20, 20181 min readUpdated on November 4, 2023

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
Tags#linux#SSH
Share

Need Hosting or Servers?

Discover our VPS, dedicated servers and professional hosting solutions

Related Articles

View all articles