5

I'm using OSX High Sierra and bash. I'm trying to use a backup script based on IPv6 LLA (so I always reach the server, without DHCP, names etc).

With IPv4 this works:

rsync -e ssh /src/dir/* user@192.168.0.1:/dst/dir

On Linux/Bash this works:

rsync -e ssh /src/dir/* user@[fe80::a:b:c:d%eth0]:/dst/dir

But on OSX terminal this didn't work.

ssh: Could not resolve hostname [fe80: nodename nor servname provided, or not known
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-52/rsync/io.c(453) [sender=2.6.9]

I've tried a lot of quotes combinations but without success.

Thank you!

migrated from serverfault.com Nov 11 '17 at 21:05

This question came from our site for system and network administrators.

  • 1
    Does ssh work on its own with IPv6? – Ignacio Vazquez-Abrams Nov 11 '17 at 20:57
  • 1
    Yes, using for example "ssh user@fe80::a:b:c:d%en0". So, ssh working fine. – Jorge Nov 11 '17 at 21:08
  • It might be relevant which version you are using. What does rsync --version say on each machine? – kasperd Nov 11 '17 at 22:15
8

The problem was with the OSX version of rsync. I don't know exactly what is the problem. It should be some of capabilities of rsync binary/version.

OSX version:

/usr/bin/rsync --version
rsync  version 2.6.9  protocol version 29
...
Capabilities: 64-bit files, socketpairs, hard links, symlinks, batchfiles,
              inplace, IPv6, 64-bit system inums, 64-bit internal inums

Installing a version from macports:

/opt/local/bin/rsync --version
rsync  version 3.1.2  protocol version 31
...
Capabilities:
    64-bit files, 64-bit inums, 64-bit timestamps, 64-bit long ints,
    socketpairs, hardlinks, symlinks, IPv6, batchfiles, inplace,
    append, ACLs, xattrs, iconv, symtimes, no prealloc, file-flags,
    HFS-compression

Although both have the IPv6 support, this 2.6.9 distributed with OSX doesn't work as expected.

With 3.1.2 I can use:

rsync -e ssh /src/dir/* user@[fe80::a:b:c:d%eth0]:/dst/dir

Thanks for helping.

  • It works fine for me with the builtin version, so I'm not convinced it's the macPorts version that fixed it. I see two possible problems: on macOS, the interface will be "en0", not "eth0". Also, [ ] is a shell character-match wildcard; it's unlikely to match anything, but just in case you should put quotes around it (rsync -e ssh /src/dir/* "user@[fe80::a:b:c:d%en0]:/dst/dir"). – Gordon Davisson Nov 12 '17 at 4:42

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .