Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
share|improve this question
man ssh_config can help on the client side – c4f4t0r Apr 19 '14 at 18:26
Does the connection disconnect if you press a key in the SSH window after freezing? It might take a minute or two before it disconnects. If this is the case, then network connectivity problems between the two cause this problem. – Tero Kilkanen Apr 20 '14 at 0:48
I see the same behavior in connecting via SSH to Rackspace Cloud Servers after upgrading my workstation to 14.04. This implies it's a client bug and not something wrong with sshd or Azure. – jalefkowit May 30 '14 at 19:22
I had the same problem, resolved it by using Mosh. – Janus Troelsen Jun 3 '14 at 14:33
As a workaround i run this script when idling: while true; do echo -n $'\r'$i; echo -n $(date +"%H:%M:%S"); sleep 5; done – LatinSuD Jun 4 '14 at 12:26

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


share|improve this answer
Perhaps KeepAlive yes is missing. At any rate I think keepalives will solve this user's problem nicely. The only risk with keepalives is that connection problems can trigger the connection to die whereas without keepalives some connectivity problems between you and server may go unnoticed gracefully. – regulatre Jun 6 '14 at 14:30

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.