Using IPv6 for SSH connections issues

9,106

The error message you got is because you included the /64 after the address. It's the prefix length used to know which IP addresses are in the network segment directly attached to that interface. It's not part of the IP address and shouldn't be passed to commands like ssh.

If you remove /64, you will no longer get that error message.

kasperd@alpha:~$ ssh 2001:db8::1/64
ssh: Could not resolve hostname 2001:db8::1/64: Name or service not known
kasperd@alpha:~$ ssh 2001:db8::1
kasperd@beta:~$ 

Specifying an interface to use is only needed if the address is a link-local address.

kasperd@alpha:~$ ssh fe80::200:5eff:fe00:53cf/64
ssh: Could not resolve hostname fe80::200:5eff:fe00:53cf/64: Name or service not known
kasperd@alpha:~$ ssh fe80::200:5eff:fe00:53cf
ssh: connect to host fe80::200:5eff:fe00:53cf port 22: Invalid argument
kasperd@alpha:~$ ssh fe80::200:5eff:fe00:53cf%eth0
kasperd@beta:~$ 
Share:
9,106

Related videos on Youtube

M. Loewenthal
Author by

M. Loewenthal

Updated on September 18, 2022

Comments

  • M. Loewenthal
    M. Loewenthal almost 2 years

    I'm having issues understanding how to use the IPv6 protocol to connect to other computers over SSH. I tried just using the address provided from ifconfig but it doesn't seem to work, I keep getting an error:

    ssh: Could not resolve hostname xxxx::xxxx:xxxx:xxxx:xxxx/xx: Name or service not known
    

    I read somewhere that I might need to define which interface I want to use, but I'm not sure.

    • Adail Junior
      Adail Junior about 6 years
      Which Ubuntu version are you using? The IPv6 is enabled in your system? We use IPv6 all the time here and there is no special treatment to connect: ssh fd77:something....::45
    • M. Loewenthal
      M. Loewenthal about 6 years
      My client is 17.10, but the server I'm connecting to is 14.04. is there something I need check?
    • Adail Junior
      Adail Junior about 6 years
      Can you ping the other server? with Ipv6
    • M. Loewenthal
      M. Loewenthal about 6 years
      Yeah, I can connect over ipv4. It's just the IPv6 part
    • Adail Junior
      Adail Junior about 6 years
      But can you ping the ipv6 address ?
    • M. Loewenthal
      M. Loewenthal about 6 years
      I'll check. I have time later tonight to try it
    • Adail Junior
      Adail Junior about 6 years
      And other thing, print the output of: ss -ltn executed in your server
    • Sander Steffann
      Sander Steffann about 6 years
      Don't copy&paste the /64 bit at the end. That's not part of the address, that is the prefix length of your network.