15
4
I have a small local network that piggybacks on a captive WiFi, and I use ssh
on OS X with -oServerAliveInterval=240
and PuTTY 0.62 on Windows 7 Professional for establishing connections to my Linode, Hetzner and other servers.
With PuTTY, I select Connection
→ Sending of null packets to keep session active
to 240. The Enable TCP keepalives (SO_KEEPALIVE option)
is off, as per defaults.
When my internet is temporarily down for about a minute (have to re-authenticate on the captive portal), PuTTY almost always loses all open ssh sessions that I have, and especially those where there was any kind of activity, but OpenSSH on OS X never loses any sessions as long as my internet is back up within about a minute or two, even if I actually try to type something in ssh, and see no reply for the whole 60 seconds or so, until my connection is active again. (So I know for sure that NAT states are always preserved.)
Can I stop Windows / PuTTY from preemptively discarding good connections?
It seems to me as if SO_KEEPALIVE or some such is actually on by default in Windows, and the timeout for detecting stale connections is way too small. I would like to increase it to something more than a couple of seconds, similarly to how OS X is immune to these brief temporary outages as long as the outage is only a couple of hundred seconds and is below the value of -oServerAliveInterval
(times ServerAliveCountMax
).
I've been using putty for 10 years now and haven been looking for a solution to this since the beginning. This pain point can only be mitigated, not solved. Putty requires a 100.00% reliable internet connection and 0.00% dropped packets. In the new world of always-spotty-internet everywhere, putty is becoming less and less useful as the years go by because it can only work for a few minutes at a time before you have your work interrupted, and have to restart putty, reconnect, then pick up where you left off, uncorrupt the corrupted files, and try to get your work done before the next outage. – Eric Leschinski – 2014-10-26T17:59:45.693
@EricLeschinski, you are incorrect. This mitigation outlined in this question works just fine, I haven't had my IPv4 connections interrupted in a very, very long time. (Apart from cases where the whole IPv4 address changes, or I do a sleep etc -- for those cases,
mosh
is a better alternative.) – cnst – 2014-10-27T17:49:55.690Just writing in to say I have the same problem and to upvote... will be watching this question. I assume it has something to do with the network driver implementation on Windows. – allquixotic – 2013-01-07T21:06:03.853