-1

I configured sshd on my remote host with /etc/ssh/sshd_config.d/custom.conf:

AddressFamily inet6
PermitRootLogin yes
PubkeyAuthentication no
Match Address fe80::d075:6982:4410:e071

This is a fresh installation of openssh-server on my host's Ubuntu LTS, I haven't changed anything in /etc/ssh/sshd_config. ip l on my remote host returns:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eno1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN mode DEFAULT group default qlen 1000
    link/ether 18:60:24:be:5c:f6 brd ff:ff:ff:ff:ff:ff
    altname enp2s0
3: wlo1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP mode DORMANT group default qlen 1000
    link/ether e4:42:a6:15:fa:63 brd ff:ff:ff:ff:ff:ff
    altname wlp3s0

but I when I use my host's wireless interface as the optional parameter after % then I cannot ssh into it, both the following commands:

ssh -6 root@fe80::cc08:9465:8dba:15a9%wlo1
ssh -6 root@fe80::cc08:9465:8dba:15a9%wlp3s0

return these errors respectively:

ssh: Could not resolve hostname fe80::cc08:9465:8dba:15a9%wlo1: Name or service not known
ssh: Could not resolve hostname fe80::cc08:9465:8dba:15a9%wlp3s0: Name or service not known

I can ssh to the host when specifying my wireless interface on my local host, ssh -6 root@fe80::cc08:9465:8dba:15a9%wlp4s0 but I cannot scp a file, scp -6 ~/.ssh/id_rsa.pub root@fe80::cc08:9465:8dba:15a9%wlp4s0:~ returns

ssh: Could not resolve hostname fe80: Temporary failure in name resolution
lost connection

I've tried wrapping the address along with the interface, like so scp -6 ~/.ssh/id_rsa.pub root@[fe80::cc08:9465:8dba:15a9%wlp4s0]:~ in braces but to no avail. fe80::cc08:9465:8dba:15a9%wlp4s0 is reacheable with ping. Both hosts are on the same, wireless LAN and have Ubuntu LTS Desktops, 22.04 as their operating systems. I've opened port 22 on the remote host - ufw status on the remote host returns

Status: active

To                         Action      From
--                         ------      ----
22/tcp                     ALLOW       fe80::d075:6982:4410:e071 

What is happening here?

  1. Why can't I ssh specifying target's interface instead of my own?

  2. I can ssh to the remote host from my local host, why can´t I scp a file into it?

  3. Where could I read more on the notation used for optionally specifying the interface (Chat GPT3.5 suggested using it as I was not able to connect with just bare IP)? Ctrl-F % on https://man.openbsd.org/OpenBSD-current/man1/ssh.1, or on man ssh returns nothing.

2
  • 3
    The square brackets seem like the right approach, yet for that you gave us only vague "to no avail" instead of an actual error. Nov 18, 2023 at 17:35
  • 1
    @MartinPrikryl You are right. Square brackets work fine. I had a typo around those square braces that I have not noticed before - my bad. That's why I was thinking they do not work.
    – John Smith
    Nov 18, 2023 at 18:59

1 Answer 1

0

Why can't I ssh specifying target's interface instead of my own?

Link local addresses are all in exactly the same CIDR range for every device in the world.

The reason that the interface needs to be specified is that the OS needs to know where to route the request. Normally the CIDR range of the IP address would tell the OS which interface to use by way of the routing table, but since link local addresses are all in the same range, this can't work and you need to explicitly tell the OS which interface to send the request from.

You must log in to answer this question.

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