SSH Double Tunnels
2007.12.15 15:07I’m definitely late to the party on this one, but I found it interesting.
I needed to talk to port 8080 on a box named prod. But the port was only exposed locally, and I could only get to prod from another box named dev. I have accounts on both.
For this example, prod’s IP address is 1.2.3.4.
In my .ssh/config
Host dev LocalForward 50522 1.2.3.4:22 Host prod Host localhost Port 50522 LocalForward 50588 localhost:8080
So, after I ssh to both dev and prod (using ssh -fN if I don’t need active shells), I can bring up http://localhost:50588 in a browser.
I’m into it.
category: code
1 comment
Andreas Krey
/2008.01.20 04:58
Try ‘ProxyCommand “ssh dev netcat 1.2.3.4:22″‘ in prod (not sure about the exact netcat spell, though).