Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I try to use scp over IPv6 addresses I get this:

scp -6 osis@::1:/home/osis/test.file ./test.file
ssh: Could not resolve hostname : Name or service not known

With scp all I ever get is

ssh: Could not resolve hostname : Name or service not known

using this I get a login into my box without a hitch

ssh osis@::1
share|improve this question
up vote 21 down vote accepted

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).

share|improve this answer
thank you for your answer, this info was somehow missing from man scp;man ssh – Osis Nov 22 '10 at 14:24
Consider submitting an updated man page, then you can say: I helped. – Martin Owens -doctormo- Nov 22 '10 at 17:26
When using the -6 flag, you can just type localhost instead of ::1 (which is the IPv6 Address for localhost) to avoid the brackets and therefore any need to escape something on the shell: scp -6 osis@localhost:/home/osis/test.file ./test.file – freddyb Apr 30 '11 at 16:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.