+4 votes
306 views
How to Increase Linux SSH Timeout

in Linux / Unix by (551k points)
reopened | 306 views

1 Answer

+5 votes
Best answer

How to increase SSH connection times in Linux

The SSH (Secure Shell) connections are a design based on the client / server model with which we can connect remotely to a computer and, as its name implies, allows secure connections..

 

 

characteristics
Some of its characteristics are:
  • Once the initial connection is established, the client can verify that it has connected to the same server where it was connected before
  • All the information that is transmitted uses 128-bit encryption.
  • X11 applications can be forwarded from the server.

 

One of the most common failures with SSH connections is the waiting times which are limited and if the remote computer does not respond in that time range the connection will be lost. This is why TechnoWikis will explain how to increase this SSH time.

 

 

How to increase SSH connection times in Linux

 

Step 1

We access the SSH configuration file with the desired editor:
 sudo nano / etc / ssh / sshd_config 
In this file we must locate the following lines:
 #ClientAliveInterval #ClientAliveCountMax 

image

 

Step 2

These values ​​allow:
  • ClientAliveInterval: Specifies the time in seconds in which the server will wait before sending a null packet to the destination computer in order to preserve connectivity.
  • ClientAliveCountMax: this line is in charge of defining the number of active (live) messages from the client that have to be sent without receiving a message from the client, in case of reaching that limit, the sshd daemon will leave the session which gives as result that the ssh session is closed, the default value is 3

 

The time usage syntax in SSH is as follows:

 Timeout value = ClientAliveInterval * ClientAliveCountMax 
In this line we can enter the following:
 ClientAliveInterval 1200 ClientAliveCountMax 3 

image

 

Step 3

The global waiting time is the multiplication of both values ​​(1200 x 3) which gives 3600 seconds, with this we have enough time for the SSH session to remain active.

 

This value can be entered directly in the following way:

 ClientAliveInterval 3600 

image

 

Step 4

After this we save the changes with the Ctrl + O keys and exit the editor with the Ctrl + X keys.
We reload the service with the command:
 sudo systemctl reload sshd 

image

 

Thus we have increased the times of the SSH connection in Linux..

 


by (3.5m points)

Related questions

+3 votes
1 answer
asked Nov 17, 2019 in Linux / Unix by backtothefuture (551k points) | 288 views
+5 votes
1 answer
+4 votes
1 answer
asked Sep 29, 2019 in Linux / Unix by backtothefuture (551k points) | 273 views
+3 votes
1 answer
asked Oct 22, 2019 in Internet by backtothefuture (551k points) | 1.1k views
+5 votes
1 answer
asked May 26, 2019 in Linux / Unix by backtothefuture (551k points) | 342 views
Sponsored articles cost $40 per post. You can contact us via Feedback
10,634 questions
10,766 answers
510 comments
3 users