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

Re: How to use ssh tunnel to reach a machine on a private network?



Oliver Elphick wrote:
I wonder if anyone can help me work out how to do this, please:

I have two private networks (192.168.1.0/24) each with a firewall
machine connecting through ADSL to the Internet.  Each private network
can reach the Internet through the firewall (using NAT); therefore no
machine except the firewall is visible from outside (at static IP
addresses allocated by the ISP).

I can, from any machine on either private network, do
"ssh -X remote.firewall.address" and connect to the remote firewall. What I am trying to do is to use ssh tunnelling to go direct to one of
the machines on the remote private network, because I need to be able to
run X programs from that machine on my own display.  However, I can't
work out how to do it.

So far, I tried

   ssh -X -L 8877:remote.private.machine:22 remote.firewall.address

(using 8877 as an arbitrary unassigned port) but all that gives me is a
connection to the remote firewall itself.


I do this all the time.

joe@bill$ ssh -L 10001:localhost:10001 ted.domain.com
joe@ted$ ssh -L 10001:localhost:5901 rufus.domain.com
joe@rufus$

Adjust port numbers and options as necessary.

-Roberto

Attachment: pgp2194j3yjpq.pgp
Description: PGP signature


Reply to: