Freezing act of SSH connection – Do you want to maintain an active connection?

Freezing act of SSH connection – Do you want to maintain an active connection?

It’s tough to maintain the connection active when the act of SSH connection freeze takes place. This process symbolically represents that the SSH connection is inactive now later it got frozen. You can even say it got stuck with the last ending process.

So, first, you are losing up the connection and then it got frozen immediately. Your target is maintaining the connection active at all times so that, it won’t get freeze.

Go to /etc/ssh/sshd_config and make some changes such as:

Code:
TCPKeepAlive yes
ClientAliveInterval 30
ClientAliveCountMax 99999
Now, you are in helplessness situation because your command of restarting the ssh daemon service won’t listen to your moves.

Look at the client configuration changes and make some edits:

Code:
/etc/ssh/ssh_config
Host *
ServerAliveInterval 100
ServerAliveInterval:The word ServerAliveInterval represents 100 here. It means you need to send null packets for the represented seconds in the command. For every 100 seconds, your server must receive null packets without fail. It is the only way to keep your connection active in the case, if you fail to give null packets, you will be ending up the connection immediately.

The normal frequent flow starts between the server and client by exchanging the null packets with themselves.

Here’s the step to configure the server part of the sshd:

Code:
/etc/ssh/sshd_config

ClientAliveInterval 60
TCPKeepAlive yes
ClientAliveCountMax 10000
ClientAliveInterval - Again, ClientAliveInterval is allotted 60 seconds. Here’s a twist – In the upper portion, you will be sending null packets for 100 seconds once. It makes a wide difference here by asking the server to keep patience for 60 seconds that too before processing the null packets from the server to client.

TCPKeepAlive – It helps the firewall not to drop the connections that are idle.

ClientAliveCountMax – The purpose of using this statement is to pass alive messages from the server to client. So, the server doesn’t expect any reply from the client end.

Now, do ssh server restart by executing the below command:

service ssh restart or service sshd restart

It entirely depends on the server activity.
Author
kumkumsharma
Views
3,359
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top