[NTLUG:Discuss] Script to (re)initiate a SSH port forwarding session
David Simmons
dave at dgnal.net
Thu Sep 20 09:02:19 CDT 2007
Guys/Gals,
Was hoping someone has had experience with this and
could forward whatever script their using:
Scenario: Say,
for totally hypothetical reasons, that I need to port forward to get
around company's restrictive firewall - am currently running the
command:
ssh -ND 9999 outside.server.com
this sets
up a proxy port that I change in FireFox to forward all browser requests
to (i.e. I setup FireFox to use the proxy at port 9999 - all local firefox
requests are proxied to local port 9999, which is then automagically
ssh-encrypted, forwarded to an outside machine and returns the webpage to
my 'behind the firewall'ed machine.)
System works great until
'ole master of firewall' closes my session and I get a "Read from
remote host outside.server.com: Connection reset by peer"....while I
initially thought it might have been a sshd_config issue on the
outside.server.com machine - the same setup works great when I'm on my
home network....SO...sometype of system/script must be shutting down my
ssh session.
I'm looking for a script that can (re)initiate the
SSH session when it goes down perpetually (or at least until a
CTRL-C). Googling didn't really turn up anything - maybe my search
was wrong/bad.
Any help would be great (and I'm sure a good
lesson even to those just wanting to automate some other type of
session)
Thanks - dave (from a secured bunker, deep in the
heart of firewalled land)
More information about the Discuss
mailing list