Bug 2592 - -R bind_address not working, always bind 0.0.0.0
Summary: -R bind_address not working, always bind 0.0.0.0
Status: CLOSED INVALID
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: sshd (show other bugs)
Version: 7.2p1
Hardware: amd64 Linux
: P5 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-20 23:40 AEST by vf
Modified: 2018-04-06 12:26 AEST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description vf 2016-06-20 23:40:26 AEST
Hello!

At server running sshd with 'GatewayPorts yes'.
There is many active network interfaces:

eth0      Link encap:Ethernet
lo        Link encap:Local Loopback
tun0      Link encap:UNSPEC
tun1      Link encap:UNSPEC
tun2      Link encap:UNSPEC

IP address at eth0 is 10.10.10.10.

After connection:

./ssh 10.10.10.10 -p444 -R10.10.10.10:8081:127.0.0.1:80

I see at netstat:

#netstat -nlpt | grep 8081
tcp        0      0 0.0.0.0:8081                0.0.0.0:*                   LISTEN      8729/sshd
tcp        0      0 :::8081                     :::*                        LISTEN      8729/sshd

#ps axuf | grep sshd
root      8728  0.1  0.5  28004  2680 pts/0    S+   16:37   0:00          \_ ./ssh 10.10.10.10 -p444 -R10.10.10.10:8081:127.0.0.1:80
root      7899  0.0  0.1  27932   972 ?        Ss   14:57   0:00 /root/openssh-portable/sshd -f sshd_config
root      8729  0.0  0.5  30492  2724 ?        Ss   16:37   0:00  \_ sshd: root@pts/1
root      8749  0.0  0.1 103316   804 pts/1    S+   16:37   0:00          \_ grep ssh

How can I bind port at specified address while requesting remote port forwarding?
Comment 1 vf 2016-06-21 00:05:28 AEST
     GatewayPorts
             Specifies whether remote hosts are allowed to connect to ports forwarded for the client.  By default, sshd(8) binds remote port for-
             wardings to the loopback address.  This prevents other remote hosts from connecting to forwarded ports.  GatewayPorts can be used to
             specify that sshd should allow remote port forwardings to bind to non-loopback addresses, thus allowing other hosts to connect.  The
             argument may be ânoâ to force remote port forwardings to be available to the local host only, âyesâ to force remote port forwardings
             to bind to the wildcard address, or âclientspecifiedâ to allow the client to select the address to which the forwarding is bound.
             The default is ânoâ.
Comment 2 Damien Miller 2018-04-06 12:26:29 AEST
Close all resolved bugs after release of OpenSSH 7.7.