0

I have read various articles about how to do this, but to no avail. What I am trying to simply do is, ssh/scp from my Mac, to my Ubuntu desktop.

My Mac has a link local ipv6 address, starting with fe80. My Ubuntu desktop has ipv6 set up correctly.

If I do ipconfig in my Ubuntu desktop, I get a very weird and long address under "eth0", that looks like this:

inet6 addr: 2601:xxxx:xxxx:xxxx:yxyy:xxxx:xxxy:xxxx/64 Scope/Global

where x's are numbers and y's are letters.

I have tried to do:

ssh username@xxxx:xxxx:xxxx:xxxx:yxyy:xxxx:xxxy:xxxx

as well as some other variants, but nothing works. I also made sure that I have openssh-server installed on my Ubuntu side, via:

sudo apt-get install openssh-server

What do I need to do here?

Journeyman Geek
135k56 gold badges282 silver badges462 bronze badges
asked Feb 18, 2017 at 23:38
7
  • Can you use netstat or lsof or something else to confirm that sshd on the Ubuntu machine is listening on port 22 on the IPv6 address you're trying to connect to? Are both of these machines on the same LAN? Commented Feb 19, 2017 at 1:32
  • Hi @Spiff, I am not sure how to parse netstat or lsof... what I can tell you is that both my Mac and my Ubuntu machine are currently both connected to my home router. (Mac through wireless, Ubuntu through ethernet). However in the future, my Mac may be elsewhere, but my Ubuntu will stay put. Going back to the netstat - what am I looking for exactly? Thanks! Commented Feb 19, 2017 at 1:53
  • If you do netstat -an | grep .22 you want to see a line like tcp6 0 0 *.22 *.* LISTEN. In this output tcp6 means "TCP over IPv6", and *.22 means "any IPv6 address, port 22". Commented Feb 19, 2017 at 2:13
  • If you do sudo lsof -i6tcp:ssh you want to see a line showing some command (probably systemd but maybe xinetd or sshd) listening on TCP *:ssh or maybe TCP [some IPv6 address]:ssh. (My apologies, I don't have an Ubuntu box in front of me, so I'm trying to translate from the way it is on macOS. If in doubt, check the lsof man page on your system.) Commented Feb 19, 2017 at 2:22
  • @Spiff Ok, if I do netstat -an | grep .22, then yes, I see this: tcp6 0 0 :::22 :::* LISTEN, and when I do sudo lsof -i6tcp:ssh, then I see: sshd 6417 root 4u IPv6 20448 0t0 TCP *:ssh (LISTEN). Each of those items go by the names COMMAND, PID, USER, FD, TYPE, DEVICE, SIZE/OFF, NODE and NAME respectively... Commented Feb 19, 2017 at 3:27

2 Answers 2

1

Since both systems have link-local (fe80:) addresses, you can use those to connect. The only tricky thing is that since fe80: is attached to every interface on the Mac, you have to specify which one you want to connect via by adding a "zone index" to the address, separated by "%". So, assuming that en0 is the Mac interface that's connected to the same net as the Ubuntu desktop, you'd use:

ssh username@fe80::xyyx:xxyy:feyx:xyxx%en0
answered Feb 20, 2017 at 1:39
2
  • Thank you Gordon, I will try it. However, does this generalize to scp, and being able to ssh/scp from the mac to the desktop when I am not at home as well? Commented Feb 20, 2017 at 2:00
  • It'll work with scp as well, although you need to wrap the address in [ ] to avoid ambiguity (e.g. scp [username@fe80::xyyx:xxyy:feyx:xyxx%en0]:/path/to/remotefile /path/to/localcopy). However, it will not work when the Mac isn't on the same network segment as the desktop; you'd need to have a public IPv6 address on the Mac and connect to the desktop's 2601: address if you're anywhere other than the same network. Commented Feb 20, 2017 at 4:58
-1

You don't really have ipv6 set up on your mac. While a link local address is mandatory it is analogous to .169.254.0.0 Just cause you can ping yourself, does not mean you have connectivity to the ipv6 internet. Link local addresses are useless for this as far as I know.

I've messed around with methods including miredo, but really, setting up a tunnel or native IPv6 is the only way to do it.

The exact method would depend on how ipv6 is set up on your network. I run everything off my consumer router with SLAAC from my ISP, but your mileage may vary.

You'd still need to wrap the ip address in square brackets.

answered Feb 19, 2017 at 0:46
2
  • 169.254.0.0/24 is the IPv4 link local address space analogous to IPv6's fe80::. It is not loopback (127.0.0.1, the IPv6 equivalent of which is ::1). IPv6 is not as broken as IPv4 used to be on some OSes, so the presence of link-local addresses is not a sign that IPv6 is not set up. Lastly, you can connect from link local addresses to routable addresses on the same local link (such as an Ethernet LAN). So unless I missed where he said the machines are on different LANs, I don't think we've discovered root cause of the failure yet. Commented Feb 19, 2017 at 1:27
  • Ah. I was unaware of being able to connect to local machines over link local address. My initial assumption was no ipv6 at all. Commented Feb 19, 2017 at 1:53

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.