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
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
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
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
Thus we have increased the times of the SSH connection in Linux..