Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 23 Sep 2012 02:34:59 GMT
From:      HIROSHI OOTA <nil@mad.dog.cx>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/171882: incorrect port fowarding with server allocated port
Message-ID:  <201209230234.q8N2Yxq1089694@red.freebsd.org>
Resent-Message-ID: <201209230240.q8N2e81e068254@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         171882
>Category:       bin
>Synopsis:       incorrect port fowarding with server allocated port
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Sep 23 02:40:08 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     HIROSHI OOTA
>Release:        10-current
>Organization:
>Environment:
FreeBSD xxx 10.0-CURRENT FreeBSD 10.0-CURRENT #165 r233752: Sun Apr  1 15:27:13 JST 2012     root  amd64
>Description:
SSH standard supports server allocated port.
We can use the capability the ssh option -R 0:host:hostport.
But, I specify it multiple, all  port would be fowarded to the first port.
>How-To-Repeat:

term1$ ssh -v -R 0:localhost:23 -R 0:localhost:25 -R 0:127.0.0.1:80 -N
debug1: remote forward success for: listen 0, connect 127.0.0.1:21
Allocated port 41791 for remote forward to 127.0.0.1:21
debug1: remote forward success for: listen 0, connect 127.0.0.1:25
Allocated port 23513 for remote forward to 127.0.0.1:25
debug1: remote forward success for: listen 0, connect 127.0.0.1:80
Allocated port 59246 for remote forward to 127.0.0.1:80

term2$ telnet localhost 23513
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 xxx FTP server (Version xxx) ready.

term2$ telnet localhost 59246
Trying ::1...
Connected to localhost.
Escape character is '^]'.
220 xxx FTP server (Version xxx) ready.

these ports should be forwaded to 25(smtp) and 80(http), not 21(ftp).
>Fix:


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201209230234.q8N2Yxq1089694>