Ssh hang/timeout


#1

Whenever I ssh into my dreamhost account and leave my ssh session without any input for more than about a minute, it hangs. No further input is accepted. I can get no response from ^C, ^Z, nor any of the reset signals sent by my ssh client. I’m using ssh on mac os (Snow Leopard).

None of my ssh sessions to other hosts times out (hangs) like this. Just my dreamhost accounts.

Any suggestions? Thanks. – Eric


#2

With egg on my face, I must confess pilot error. My ServerAliveInterval was set too large in ssh_config for my dreamhost hosts. I didn’t realize that I had overridden my lower default value. This made my dreamhost sessions subject to timeouts that I didn’t anticipate. For details on this setting, and the probably cause of the timeouts, see this post:

http://www.openssh.org/faq.html#2.12


#3

How and why did you manage to set this value? I’ve not had any issues with the default settings.


#4

You can control the value of ServerAliveInterval in your ~/.ssh/config file. Depending on the version of ssh, the default value of this is either 0 (no keep alive at all) or 3 (which means to send a null packet every 3 seconds to keep the connection alive).

In my case, the default value of this was set to 60 (60 seconds), but I had this overriden (for some unknown reason) to 300 (5 minutes) in the settings for my dreamhost accounts. Evidently, somewhere along the route from my machine to the dreamhost host someone was timing the connection out earlier than 5 minutes.

Does that answer your question? – Eric


#5

That answers my question. Your unintentional increase of the keepalive broke it.