if i ssh into a device (linux) on my local network using user@ipaddress vs user@devicename.local it seems as though my computer (OSX) is treated as two different devices.

I have noticed some inconsistencies with how the firewall on the device (linux) treats my machine and i am just trying to understand the logic

  • Hard to say without more details. The only thing that comes to mind is that the .local version might be using IPv6 instead of IPv4. Exactly what inconsistencies are you seeing? – Gordon Davisson Sep 27 '19 at 7:00
  • Isn't the SSH key unique to each login? And if you use two different logins don't you need two different SSH keys? – Steve Chambers Sep 27 '19 at 18:47

I think you have it backwards - it is not your computer that is treated as two different devices, rather it is the Linux device that is treated as two different devices.

The first time you connect to 111.222.333.444, the SSH (host) key of the Linux device is saved on your computer (usually in the ~/.ssh/known_hosts file). This makes it possible for SSH to check that the key is the same the next time you connect - otherwise you'll get a warning that something is up.

Similarly, the first time you connect to devicename.local, the key is again saved. SSH doesn't know that 111.222.333.444 and devicename.local is actually the same computer, so the key will be saved twice under different names on your computer.

Therefore in the future if you update one key and not the other, you'll experience different behaviour regarding host key warnings when you connect via the IP address or the host name.

Regarding the inconsistencies with your firewall - it is not entirely clear, how you think that is related to your question about the SSH keys being different. In general, a firewall on the server has no way of knowing whether you have opened the connection by typing in the IP address or host name of the server. That information is simply not transferred over the network.

If you observe a difference, it is because the host name does not translate to the same IP address as the one, you're entering manually. This can happen if the server has multiple alias IP addresses, and you're using two of those - or if the server has both an IPv4 address and an IPv6 address, and you're typing one and using a host name that is set to the other.

|improve this answer|||||

You must log in to answer this question.

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