SSH freezes when idle for a time

azuressh

Connecting from Ubuntu Desktop x64 14.04's ssh client to an Ubuntu Server 14.04 x64 SSH server on Microsoft Azure.

Unfortunately when it is connected and left idle for a time; the connection freezes but doesn't disconnect.

I have tried setting these variables in my server's /etc/ssh/sshd_config:

ClientAliveInterval 30
TCPKeepAlive yes
ClientAliveCountMax 99999

Best Answer

on the connecting client, in /etc/ssh/ssh_config, try:

ServerAliveInterval 60

not sure why the ClientAliveInterval is not working for you on the server.... maybe you need to restart sshd, if you did not do so after adding the ClientAliveInterval directive?

if you do not have root on the client, you can stick the ServerAliveInterval in

~/.ssh/config