SSH users would usually get an error like “SSH connections keep dropping”. If you lock a system after connecting it to an SSH server, you will get an error as SSH connections keep dropping. It means you are dropping out from connections at the same time!
Some users will divert working from SSH by locking the screen for some purpose and leave the system as it is. After few hours, they might see the disconnection of the SSH connection.
What are the reasons for SSH disconnect?
If the client SSH or server has the value of KeepALive.SSH gets the error message when there is an unstable connection on the internet.
You would have a small router at the same time, you may connect with more server choices. It maintains the traffic to the server regularly. In case, by maintaining the server traffic it may lose in another way of disconnection.By keeping the system lock and idle, you may face a problem of SSH disconnection within 5 minutes.
Server with KeepAlive Setting: Make sure KeepAlive value is in ssh_config. Add the below-mentioned code into the path /etc/ssh/ssh_config path
3 times you will get the request of Server Alive in 400 seconds. You will get a timeout after 20 minutes. You can change the value as per your requirement.
Putty KeepAlive value Settings: One of the best SSH clients used as Putty in Windows.
Just follow the below steps for setting Keep Alive value:
Step 1: Do putty connection and then tap on “Connection”.
Step 2: Now, you need to enter a value in Seconds between keepalives as 60. Do connection to the server by tapping on the open button.
MobaxtermKeepAlive Setting:
Step 1: Try Mobaxterm connection and then tap on “Settings”. Now select on configuration and then SSH.
Step 2: Go to the section called “SSH settings” and check the value of KeepAlive SSH.
That’s it! Now, you won’t lose the connection of SSH from the server.
Some users will divert working from SSH by locking the screen for some purpose and leave the system as it is. After few hours, they might see the disconnection of the SSH connection.
What are the reasons for SSH disconnect?
If the client SSH or server has the value of KeepALive.SSH gets the error message when there is an unstable connection on the internet.
You would have a small router at the same time, you may connect with more server choices. It maintains the traffic to the server regularly. In case, by maintaining the server traffic it may lose in another way of disconnection.By keeping the system lock and idle, you may face a problem of SSH disconnection within 5 minutes.
Server with KeepAlive Setting: Make sure KeepAlive value is in ssh_config. Add the below-mentioned code into the path /etc/ssh/ssh_config path
Code:
ServerAliveInterval 400
ServerAliveCountMax 3
Putty KeepAlive value Settings: One of the best SSH clients used as Putty in Windows.
Just follow the below steps for setting Keep Alive value:
Step 1: Do putty connection and then tap on “Connection”.
Step 2: Now, you need to enter a value in Seconds between keepalives as 60. Do connection to the server by tapping on the open button.
MobaxtermKeepAlive Setting:
Step 1: Try Mobaxterm connection and then tap on “Settings”. Now select on configuration and then SSH.
Step 2: Go to the section called “SSH settings” and check the value of KeepAlive SSH.
That’s it! Now, you won’t lose the connection of SSH from the server.