[Bug 1734] New: IPv6 address in port forward options (-L) requires square brackets

bugzilla-daemon at bugzilla.mindrot.org bugzilla-daemon at bugzilla.mindrot.org
Thu Mar 11 20:44:55 EST 2010


https://bugzilla.mindrot.org/show_bug.cgi?id=1734

           Summary: IPv6 address in port forward options (-L) requires
                    square brackets
           Product: Portable OpenSSH
           Version: 5.4p1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: ssh
        AssignedTo: unassigned-bugs at mindrot.org
        ReportedBy: jsburwell at gmail.com


This could be a documentation bug.  The manual page states:

IPv6 addresses can be specified with an alternative syntax:
    [bind_address/]port/host/hostport or by enclosing the address in
square brackets.

Keyword here is "or."  I've found that the syntax REQUIRES square
brackets around an IPv6 address regardless of which syntax is used. 
That is, if the old "colon" separator is used, or the "slash" separator
is used.  The man page implies that if you use the alternative (slash)
syntax, the square brackets may be omitted.

This is tested on several OS and versions of OpenSSH:

Ubuntu Server 9.10
ssh -v -6 -L 5902/::1/5902 host.example.com
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g 19 Oct 2007
Bad local forwarding specification '5902/::1/5902'

Gentoo Linux
ssh -v -6 -L 5902/::1/5902 host.example.com
OpenSSH_5.2p1, OpenSSL 0.9.8l 5 Nov 2009
Bad local forwarding specification '5902/::1/5902'

Cygwin 1.7.1
ssh -v -6 -L 5902/::1/5902 host.example.com
OpenSSH_5.4p1, OpenSSL 0.9.8m 25 Feb 2010
Bad local forwarding specification '5902/::1/5902'


Using square brackets works with either syntax (brackets escaped for
shell of course):

ssh -6 -L 5902/\[::1\]/5902 host.example.com
jim at host.example.com's password: 

ssh -6 -L 5902:\[::1\]:5902 host.example.com
jim at host.example.com's password:

-- 
Configure bugmail: https://bugzilla.mindrot.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching the assignee of the bug.


More information about the openssh-bugs mailing list