Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- Remote port forwarding with gateway option
- Steve Jibson
May 14, 2004, 6:36 pm
rate this thread
"ssh -L80:localhost:80 bob.remote.com"
It will forward connections to my computer on port 80 to
bob.remote.com (also port 80). Now when it binds the listening
socket, it only binds to 127.0.0.1. This means that other computers
can't connect to my computer on port 80 have their connections
forwarded to bob.remote.com.
SSH allows you to change this with the "-g" argument. By specifying
the "-g", ssh binds to all local addresses (not just 127.0.0.1).
Okay, now we get to my question:
If I use
"ssh -R80:localhost:80 bob.remote.com"
Any connections made to port 80 on bob.remote.com are forwarded back
to my computer. Once again, however, it only binds to the loopback
interface on the remote machine. What this means is frank.remote.com
cannot connect to bob.remote.com on port 80 and have his connection
forwarded to my computer.
The "-g" option seems to have no effect on remote port forwarding. Is
there a way I can get remote port forwarding to make the remote
machine "gateway" connections back to my machine?
Re: Remote port forwarding with gateway option
Usually, binding to all addresses needs to be explicitly enabled on
the server too, in most cases it's disabled by default. For OpenSSH,
this is "GatewayPorts" in sshd_config.
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
- » Disabling Encryption and just using Port Forwarding? Can that be done?
- — Previous thread in » Secure Shell Forum
- » ssh on command line: force using a group size (prime size) of 1024 (and no...
- — Newest thread in » Secure Shell Forum