Greetings. I'm using ssh 5.6p1 release and have met a problem using SFTP with IPV6 address. Here's a brief. When I ran command "sftp -6 fe80::217:8ff:fe7c:d91c", SFTP threw out below error messages. ssh: Could not resolve hostname fe80: host nor service provided, or not known Connection closed See that the hostname has been cut as "fe80", and of cource this could not be resolved. By reading sftp.c, I noticed that this happened in line 2207. 2207 if ((cp = colon(host)) != NULL) { 2208 *cp++ = '\0'; 2209 file1 = cp; 2210 } The function colon(…) is used to analyze if user's input command is like “sftp host_address:/directory”. If it is, colon(…) modifies the value of “host” from “host_address:/directory” to “host_address”, and returns value “/directory” to string “cp”. In current case, I think colon(...) incorrectly cuts a valid IPV6 address. Would you please verify this bug and do a fix? Thanks.
Since sftp allows users to use enter command like "sftp address:/directory", there could also be some problems when address is an IPV6 address.
You should enclose IPv6 addresses in square brackets to avoid ambiguity. E.g. sftp [::1] I'll add a note to sftp.1: +.Pp +Since some usage formats use colon characters to delimit host names from path +names, IPv6 addresses must be enclosed in square brackets to avoid ambiguity. +.Pp
close resolved bugs now that openssh-5.9 has been released