How to prevent or quickly fix hosed ssh tunnels

From: Thursday (nospam_at_nospam.nospam.nospam.nospam.org)
Date: 01/25/05


Date: Tue, 25 Jan 2005 18:44:50 GMT

I have a couple of ssh tunnels going out from my adsl gateway to a
hosted server with static ip.

When the dynamic ip address is reassigned by the ISP on the gateway
(unpredictable intervals), the ssh tunnel gets hosed.

When I kill the ssh tunnel processes (kill or kill -9), the ssh tunnels
lingers with a FIN1_WAIT (spelling?) status for a long time before
eventually disappearing.

What can I do to minimize downtime to < 5 seconds? Is it possible to
kill the ssh process and *quickly* get rid of the hosed tunnel?

System: Debian Sarge, OpenSSL