July 26, 2010

Prevent connection drops on a ssh connection

Here is two ways to stop connection drops.

modify /etc/ssh/sshd_config file.
add following:

ClientAliveInterval 30
ClientAliveCountMax 5

and restart sshd:

/etc/init.d/ssh restart

OR

modify /etc/ssh/ssh_config

ServerAliveInterval 15
ServerAliveCountMax 3