Re: ssh port forwarding

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Quoted text here. Click to load it

If I understand your question correctly, it's the
'GatewayPorts' option in /etc/ssh/sshd_config.

Re: ssh port forwarding

    bill> Does anyone know how I can make SSH bind to something besides
    bill> localhost when using ssh -R?  If I connect to my Windows maching
    bill> running SSHD and forward the port it binds to my network IP so
    bill> everyone can get to the port.  When I connect to my Linux
    bill> machine with the same options I can only connect to the
    bill> forwarded port from localhost.  I've searched around a bit and
    bill> can't come up with a way to do this.  Does anyone know if this
    bill> is possible?

You did not say what SSH software you're using on the server.  If it's
OpenSSH, read the man page:

% man sshd_config
             Specifies whether remote hosts are allowed to connect to ports
             forwarded for the client.  By default, sshd binds remote port
             forwardings to the loopback address.  This prevents other remote
             hosts from connecting to forwarded ports.  GatewayPorts can be
             used to specify that sshd should bind remote port forwardings to
             the wildcard address, thus allowing remote hosts to connect to
             forwarded ports.  The argument must be ``yes'' or ``no''.  The
             default is ``no''.

Unfortunately, with OpenSSH, this is a global setting on the server and
applies to all remote forwardings.  The client and server allow
this to be selected by the client per-forwarding.

  Richard Silverman

Re: ssh port forwarding

Quoted text here. Click to load it
 [GatewayPorts snipped]

Quoted text here. Click to load it

Fixing this in OpenSSH is an open enhancement request [1].  If you're
not patch-phobic, you can try one of the patches attached to it.


Darren Tucker (dtucker at
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.

Site Timeline