Normally each computer has its own distinct IP-address. There are a few cases where this is not true:
- if the computers are configured with DHCP, it is possible for one machine to reuse an IP-address made available from another which lost its lease, e.g., by turning it off for a while
- less often, someone decides to reuse the same IP-address for more than one machine. That may be due to firewall limitations, to a decision to reuse the address for deploying identical machines, etc.
For the DHCP case, there's no alternative other than by deleting obsolete entries in
~/.ssh/known_hosts. That is the whole point of ssh remote host identification has changed
On the other hand, deliberately reusing IP-addresses can be cumbersome and less secure if one simply removes "incorrect" keys from the
known_hosts file. If the machines really are "identical" (and do not run concurrently), then you can reuse the ssh server keys on multiple machines.
For example, in
/etc/ssh/sshd_config on one machine, I have
Those files (and their public counterparts, suffixed with ".pub") could be copied to one of the "identical" servers, and
sshd restarted. After that, both copies of the machine would act as the same machine.
On the other hand, if you don't have to setup a reduced-resource configuration, using a different IP-address for each machine is more straightforward.