Ssh Server Disconnect

Ssh Remote Server Disconnection

Only an opinion should this not be in the security menu - Delboy

Introduction

Ubuntu is a very stable and a very reliable operating system, however when remotely connecting to it form an equally Ubuntu Desktop variant using the ssh protocol it has a tendency to disconnect or lockup for no apparent reason. The reason it disconnects is to prevent you damaging the server computer by the use of commands that by mistake may be run due to the fact the "ssh" connect remains open. It is also a pain in the ass....

I would like to take the credit for this fix but in truth someone else is most definitely responsible, not me. In order to sustain an Ssh remote connection you will need to edit the /etc/ssh/ssh_config file on the client (Desktop) computer, NOT the server. This problem is not always apparent on Linux Operating Systems but definitely can be witnessed on the Ubuntu and Ubuntu variants.

You will need to add only two new lines of code to ssh_config file,

ServerAliveInterval 30
ServerAliveCountMax 4

but only on your client Desktop PC, the server does have the same "ssh_config" file but needs not be touched.

Now when you remotely connect to another server using the "ssh" with this adjusted config file you should be able to maintain a much longer connection than possible previously.