Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

1 Answer 1

up vote 12 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
1  
Consider submitting an updated man page, then you can say: I helped. –  Martin Owens -doctormo- Nov 22 '10 at 17:26
1  
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

 
discard

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.