ssh: how to make it drop the connection when it is not connected?
john_owens_at_yahoo.com
Date: 08/20/04
- Previous message: Darren Tucker: "Re: SSH through inetd"
- Next in thread: Andrew Schulman: "Re: ssh: how to make it drop the connection when it is not connected?"
- Reply: Andrew Schulman: "Re: ssh: how to make it drop the connection when it is not connected?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: 19 Aug 2004 16:24:31 -0700
I've set up a ssh tunnel that runs at startup so that I can send mail
when I'm off-campus:
#!/bin/sh
# http://cg.scs.carleton.ca/~morin/misc/laptopmail/
. /etc/rc.common
ConsoleMessage "Starting smtptunnel"
while [ 1 ]; do
ssh -N -L25:mailserver:25 username@mailserver
sleep 5
done
The loop should make it maintain the connection when it drops.
Unfortunately, when it is set up and then I lose network connectivity
(sleeping my machine and waking it back up, or leaving wireless range),
it doesn't drop the connection; instead it maintains some sort of
zombie connection.
When the connection works properly, I can do the following:
% telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 mailhost ESMTP Sendmail 8.12.11/8.12.11; Wed, 18 Aug 2004 18:\00:36
-0700
^]
telnet> close
But when I don't have connectivity, the tunnel still appears to be
active (even though it can't connect):
% telnet localhost 25
Trying ::1...
Connected to localhost.
Escape character is '^]'.
^]
telnet> close
What I really want is when the ssh tunnel is not "connected" (cannot
find its destination) then it ends; right now it is just a zombie
connection, and I have to manually kill it and restart when I get back
into network range.
Suggestions?
(OS X 10.3.5, OpenSSH_3.6.1p1+CAN-2003-0693, SSH protocols 1.5/2.0,
OpenSSL 0x0090702f)
JDO
- Previous message: Darren Tucker: "Re: SSH through inetd"
- Next in thread: Andrew Schulman: "Re: ssh: how to make it drop the connection when it is not connected?"
- Reply: Andrew Schulman: "Re: ssh: how to make it drop the connection when it is not connected?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|