15.5. Copying Files over IPv6 with scp
Problem
SSH works fine for logging in to remote PCs using IPv6 addresses, but when you try to copy files with scp, it doesn't work. You are rewarded with the unhelpful message:
ssh: fe80: Name or service not known lost connection
Now what?
Solution
scp requires some strange syntax that you have to get just right, as this example shows:
$ scp filename carla@\[fe80::203:6dff:fe00:83cf%eth0\]:The IPv6 address must be enclosed in brackets, which must then be escaped. If you're logging in as a different user, the username goes outside the braces. And you must specify the local interface with the percent sign for Link Local addresses, just like with OpenSSH.
Discussion
As this was written, neither the scp nor the OpenSSH manpages described the special IPv6 syntax, so you read it here first.
See Also
man 1 sshman 1 scp
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access