How to make scp to use ipv6 addresses?

scp requires some special syntax. The IPv6 address must be enclosed in brackets, which must then be escaped. So in your example it would look like this:

scp -6 osis@\[2001:db8:0:1\]:/home/osis/test.file ./test.file

Otherwise the first colon ':' is thought to be the separator between the file and the address parts which would result in

ssh: Could not resolve hostname 2001: Address family for hostname not supported

In your example with the ip ::1 it is interpreted as if you want to ssh to the host '' (blank).

Tags:

Scp

Ipv6