Bug 2899 - scp remote-to-remote does not work with IPv6 addresses anymore
Summary: scp remote-to-remote does not work with IPv6 addresses anymore
Status: NEW
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: scp (show other bugs)
Version: 7.7p1
Hardware: Other Linux
: P5 enhancement
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-25 01:24 AEST by Jakub Jelen
Modified: 2018-08-25 01:24 AEST (History)
0 users

See Also:


Attachments
proposed patch (536 bytes, patch)
2018-08-25 01:24 AEST, Jakub Jelen
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Jelen 2018-08-25 01:24:46 AEST
Created attachment 3172 [details]
proposed patch

Using IPv6 addresses for remote-to-remote transfers does not work anymore. This worked fine in OpenSSH 7.4 and before.

  # scp -r -vvv jjelen@\[::1\]:/home/jjelen/Documents/abeceda.txt jjelen@\[::1\]:/tmp/

fails with the error

  debug1: resolve_canonicalize: hostname  is an unrecognised address
  ssh: Could not resolve hostname : Name or service not known
  lost connection

This issue express itself earlier in the log as IPv6 address in the URI that is not enclosed in the square brackets:

  Executing: /usr/bin/ssh -x -oClearAllForwardings=yes -t -v -v -v -l jjelen -- ::1 scp -v -r /home/jjelen/Documents/abeceda.txt jjelen@::1:/tmp/

This leads in the end to empty hostname:

  Executing: program /usr/bin/ssh host , user jjelen, command scp -v -r -t :1:/tmp/

and to the error above.

This can be pretty simply addressed by the attached patch.