Modificar el fichero /etc/ssh/sshd_config  para que incluya las siguientes líneas:

TCPKeepAlive yes
ClientAliveInterval 30
ClientAliveCountMax 99999