1 Aug 2010 07:51
Re: Fun* with ssh tunnels
David L. Anselmi <anselmi <at> anselmi.us>
2010-08-01 05:51:08 GMT
2010-08-01 05:51:08 GMT
Don Marti wrote: > I used to do this something like... > > ssh -L 10025:localhost:25 $MAILHOST sleep 5& > [...] > > /usr/bin/ssh -A -L 10025:localhost:25 \ > -R 10022:localhost:22 \ > $MAILHOST \ > /usr/bin/ssh -p 10022 localhost /usr/sbin/postqueue -f > > So the "postqueue" command is running on the client. *That* is fun. How creative. Might this also work though: ssh -L 10025:localhost:25 $MAILHOST -N -f && /usr/sbin/postqueue -f This seems to do the right thing if ssh can't connect, but maybe not if it connects but the remote port isn't listening. Also the setting of ExitOnForwardFailure might matter. The connection stays open (in the background) until signaled to stop. I think yours will be all cleaned up after postqueue runs so maybe the extra convolution is worth it. Cheers! Dave _______________________________________________ Do not Cc: anyone else on mail sent to this list. The list server is set for maximum one recipient.(Continue reading)
RSS Feed