Preventing SSH RSA host key warnings for change of key vs IP address

Posted by Adam M-W on Super User See other posts from Super User or by Adam M-W
Published on 2012-06-17T14:53:07Z Indexed on 2012/06/17 15:18 UTC
Read the original article Hit count: 223

Filed under:
|
|

I have a network with DHCP enabled, and also a computer that dual boots operating systems and has different SSH keys on each (and yes, I would like to keep different keys on each rather than copying the same identity/private key to each). Because the IP address does not change between operating systems because the MAC address is the same, when connecting to ssh, even when not using the IP address but the hostname via DNS/mDNS, I get the warning:

Warning: the RSA host key for 'hostname' differs from the key for the IP address '192.168.1.172'
Offending key for IP in /Users/user/.ssh/known_hosts:37
Matching host key in /Users/user/.ssh/known_hosts:38
Are you sure you want to continue connecting (yes/no)?

How can I surpress the warning when the hostname differs from the IP address for that hostname, but retain the ability to check host keys are the same for each hostname? (each OS has a unique hostname)

© Super User or respective owner

Related posts about ssh

Related posts about dhcp