[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to make persistant ssl tcp tunnels with openssh



On Mon, Aug 20, 2001 at 08:52:36AM -0500, Steven Pritchard wrote:
> Jordan Bettis said:
> > My problem is that if I don't have that term open running ssh, the ssl tcp
> > tunnel is closed, so how do I make it so that the tunnel is always open?
> 
> Look at the "preconnect" option for fetchmail.  (You'll probably want
> to add something like 'port 31337 preconnect "ssh -f -L
> 31337:localhost:110 $mailserver sleep 20" to your .fetchmailrc.)

That's basically what I ended up doing, but with a shell script like this:

#!/bin/sh
/usr/bin/ssh -f -L 1234:localhost:110 trillian.hafd.org sleep 15
/usr/bin/fetchmail -s

rather than preconnect. I know there's a way to do it by giving ssh a -N
but when I do that, the connection immedently closes for some reason.

Then I have cron run that script every three minutes. It's duct tape and
chicken wire, but it seems to work, and it's better than unencrypted pop3.

-- 
Jordan Bettis <http://www.hafd.org/~jordanb>
One can't proceed from the informal to the formal by formal means.
          -- Alan J Perlis: Epigrams in Programming, ACM SIGPLAN 1982
-
To unsubscribe, send email to majordomo@luci.org with
"unsubscribe luci-discuss" in the body.