Option -g notworking properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openssh (Debian) |
New
|
Unknown
|
|||
openssh (Ubuntu) |
Triaged
|
Wishlist
|
Unassigned |
Bug Description
Binary package hint: openssh-client
When you try to make a ssh-tunnel with the -g option it doesn't work.
ssh -g -L 1433:remote_
This should open local port 1433 and redirect the connection via a ssh tunel to "another_host". Then send from this machine to "remote_host". It was working perfectly in an old machine.
If you try using the -g option (allow remote conections on local port) it binds to 0.0.0.0 (all interfaces) on the machine, but dumps this error:
bind: Address already in use
And it's oppening and using the port but not forwarding connections. An strace shows that it's traying to open the socket ¿twice?:
socket(PF_INET, SOCK_DGRAM, IPPROTO_IP) = 4
connect(4, {sa_family=AF_INET, sin_port=
getsockname(4, {sa_family=AF_INET, sin_port=
close(4) = 0
socket(PF_INET6, SOCK_STREAM, IPPROTO_TCP) = 4
setsockopt(4, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(4, {sa_family=
listen(4, 128) = 0
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfb716b8) = -1 EINVAL (Invalid argument)
ioctl(4, SNDCTL_TMR_TIMEBASE or TCGETS, 0xbfb716b8) = -1 EINVAL (Invalid argument)
fcntl64(4, F_GETFL) = 0x2 (flags O_RDWR)
fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK) = 0
fcntl64(4, F_GETFL) = 0x802 (flags O_RDWR|O_NONBLOCK)
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 5
setsockopt(5, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0
bind(5, {sa_family=AF_INET, sin_port=
write(2, "bind: Address already in use\r\n", 30) = 30
I solved out problem specifying the IP address to use for binding:
ssh -L LOCAL_IP:
But the -g option should work anyway. I suppose it's a bug on ssh not just ubuntu but I can't check recent versions of other distros.
Changed in openssh: | |
importance: | Undecided → Low |
status: | New → Confirmed |
Changed in openssh: | |
assignee: | dendrobates → kirkland |
status: | Confirmed → Triaged |
Changed in openssh (Debian): | |
status: | Unknown → New |
Hello,
got the same problem today and readed some manpages
at first and used a little bit google also nerved some people on irc ;)
man ssh
-g Allows remote hosts to connect to local forwarded ports.
comment from me:
wich can be understand it is for use when doing
ssh -L (lokal) not when doing ssh -R
man sshd_config
GatewayPorts
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!!! ...... The
default is ``no''
So just edit /etc/sshd_config on the remote (-R) host
and type in
GatewayPorts yes
for checking if this works use 1:$yourportnumb er
netstat -an | grep $yourportnumber
it shows something like if not written GatewayPorts....
tcp 0 0 127.0.0.
0.0.0.0:* LISTEN
and shows
if GatewayPorts yes
tcp 0 0 0.0.0.0: $yourportnumber
0.0.0.0:* LISTEN
So all the time keep RTM :)
regards,
Daniel
-- pca.dfn. de
Retrieve my key from:
www.keyserver.de
blackhole.
horowitz.surfnet.nl
keyID 7B196671
or send email with subject "fetch key"