(run this on gateway machine)
ssh user@localhost -g -L interal_port:internal_ip:external_port -N -f
This is standard tunneling but with the -g option, which allows connections on the local machine from *any* host. Normally when you tunnel using the -L option, you can connect to localhost and access a service on another machine. No one else but you can use these forwarded ports however. -g opens up the tunnel.
You may need to allow tcp forwarding in etc/ssh/sshd_config. Add the following line:
AllowTcpForwarding yes
Also, you will need to have the external port open on the gateway machine's firewall. This is very OS specific. On Redhat Enterprise Linux, run the following in X:
system-config-securitylevel
And add the port as an 'other port' using tcp or udp.
No comments:
Post a Comment