It seems that literal IPv6 addresses are supported in rsync:// URI's (this was bug 1675, which is now fixed), but not in ssh. For example, compare the following behavior of rsync and scp: vega david ~ $ rsync -av '[fe80::213:d4ff:fee9:3951%eth1]:./empty' /tmp/ ssh: fe80::213:d4ff:fee9:3951%eth1]: Name or service not known rsync: connection unexpectedly closed (0 bytes received so far) [receiver] rsync error: unexplained error (code 255) at io.c(463) [receiver=2.6.8] vega david ~ $ scp -p '[fe80::213:d4ff:fee9:3951%eth1]:./empty' /tmp/ Password: empty 100% 0 0.0KB/s 00:00 vega david ~ $ ssh fe80::213:d4ff:fee9:3951%eth1 Password: Linux neptune 2.6.16-2-k7 #1 Sat Jul 15 23:05:41 UTC 2006 i686 <...> Here I used link-local IPv6 addresses with a scope identifier just to emphasize (and also because you don't need real IPv6 connectivity or any kind of setup to test this), but it doesn't work any better with (non-scoped) global addresses: vega david ~ $ rsync -av '[2001:7a8:7171:37:213:d4ff:fee9:3951]:./empty' /tmp/ ssh: 2001:7a8:7171:37:213:d4ff:fee9:3951]: Name or service not known rsync: connection unexpectedly closed (0 bytes received so far) [receiver] rsync error: unexplained error (code 255) at io.c(463) [receiver=2.6.8] vega david ~ $ scp -p '[2001:7a8:7171:37:213:d4ff:fee9:3951]:./empty' /tmp/ Password: empty 100% 0 0.0KB/s 00:00 This is with rsync version 2.6.8, but I also tried with today's CVS. I'd be really glad if this were fixed (especially for scoped ll addresses, as there's no way to register them in DNS, so they *must* be literal, and in some cases, when DHCP is out of order or something, ll IPv6 is the best kind of connection one can achieve!). I emphasize that this is not a dup of bug 1675. Happy hacking!
Created attachment 2144 [details] Fix to avoid skipping the leading '[' This patch gets rid of the code that skips the leading '[' before handing the hostname off to ssh. I believe that this should work OK, but I can't test it at the moment (since I can't test IPv6 at the moment). The other option would be to leave the leading '[' stripped and to add stripping of the trailing ']'.
This fix was checked into CVS.
Unfortunately, ssh will not accept hostnames within brackets (I think it should be more liberal in what it accepts), so you need to strip both '[' and ']'.
(By the way, on most systems - Linux, FreeBSD, OpenBSD, etc. - you might be able to test IPv6, even without a global IPv6 address, just by loading the module at boot and using link-local addresses, or, if even that's not an option, using ::1 which is the IPv6 loopback.)
I checked-in a fix for this last week.