[Techtalk] adsl and dyndns issues with changing IP addresses
Conor Daly
conor.daly-linuxchix at cod.homelinux.org
Wed Nov 24 23:27:35 UTC 2010
On Wed, Nov 24, 2010 at 09:31:57AM +0100 or so it is rumoured hereabouts,
Wim De Smet thought:
>
> Quick recipe:
> ssh -N -L localhost:5000:localhost:5000 <yourremotehost>
>
> What this does is, if you connect with a client on localhost and port
> 5000 (the first 2 values) on the machine where you run ssh on, it will
> tunnel the connection over to <yourremotehost> and connect to port
> 5000 on localhost there (the second two). This happens to connect to
> localhost, but you could make it www.google.com:80 if you'd so wish.
> You can add -f to background this ssh process (just keyb interrupt it
> otherwise).
>
> Using ssh-agent or the like you can make sure you don't have to fill
> in password prompts of course. It's perhaps not super robust. For one,
> I'm not sure what will happen when your IP address changes, probably
> the tunnel will take a while to time out and you'd have to use upstart
> or the like to keep an eye out for ssh dying. But it does the trick
> for me when I need to do some testing from home and need to get at the
> DB server.
I extended this idea by having a procmail rule run a script when I sent
the correct email from home. The script would set up the tunnel _from_
the work server _to_ my home machine so there was never a port open in the
firewall for incoming connections. I would then connect back by
connecting to localhost:5000
Conor
--
Conor Daly <conor.daly at cod.homelinux.org>
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/G/S/O d+(-) s:+ a+ C++(+) UL++++ US++ P>++ L+++>++++ E--- W++ !N
PS+ PE Y+ PGP? tv(-) b+++(+) G e+++(*) h-- r+++ z++++
------END GEEK CODE BLOCK------
http://www.geekcode.com/ http://www.ebb.org/ungeek/
More information about the Techtalk
mailing list