Re: 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 20:27:23 GMT

all mail refused wrote:
> In article <CswJd.9210$_B3.2424@newssvr31.news.prodigy.com>, Thursday wrote:
>
> I'd say your ISP has no business changing your IP while you have
> running connections.
>

Me too!

>
> Why do you think any action is needed ?
>

Great question.

Upon investigating further, it seems to be a problem with the remote
server not terminating the old ssh tunnels.

The remote server seems completely unaware that the old ssh tunnels must
be killed/closed. The remote server continues have an ESTABLISHED state
for the old ssh tunnels, which prevent the new tunnels from functioning
properly (the new ssh tunnels also have ESTABLISHED state on the same ports)

FYI, I'm initiating the ssh tunnel from the adsl gateway (dynamicip) to
the remote server using:

ssh [...] -N -R 8880:$DYNAMICIP:80 $STATICIP 2>&1

Is there a better way to fix this than simply having a remote .bashrc
script that kills the old ssh tunnels upon login initiated by the new
tunnel?

Would using something like stunnel instead of ssh tunnels simplify the
solution?