Ho un host chiamato nms.example.org. Nel mio /etc/ssh/ssh_known_hostsho una voce per l'host con la chiave RSA. Questa voce e tutte le altre voci sono gestite dal mio sistema di gestione della configurazione.
nms.example.org ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZqfmVPs/XqTS...
Inoltre ho una voce nel mio /etc/ssh/ssh_configper l'host specifico che imposta l'alias della chiave host. Che se capisco tutto correttamente, ciò significa che solo la nms.example.orgcosa dovrebbe importare.
Host nms.example.org nms.example nms
HostKeyAlias nms.example.org
HostName nms.example.org
Perché allora, quando mi connetto da un client ssh sembra ancora pensare di dover aggiungere una chiave ai miei host_host per utente con l' IP dell'host?
$ ssh nms -v
OpenSSH_6.0p1 Debian-4+deb7u4, OpenSSL 1.0.1e 11 Feb 2013
debug1: Reading configuration data /home/zoredache/.ssh/config
debug1: /home/zoredache/.ssh/config line 61: Applying options for *
debug1: /home/zoredache/.ssh/config line 71: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 84: Applying options for nms
debug1: /etc/ssh/ssh_config line 363: Applying options for *
debug1: Connecting to nms.example.org [104.236.190.144] port 22.
debug1: Connection established.
debug1: identity file /home/zoredache/.ssh/zoredache-20140204.id_rsa type 1
...
debug1: Server host key: RSA 6b:5f:b6:e9:13:c3:b7:39:1e:ec:74:05:33:64:4d:5e
debug1: using hostkeyalias: nms.example.org
debug1: Host 'nms.example.org' is known and matches the RSA host key.
debug1: Found key in /etc/ssh/ssh_known_hosts:104
Warning: Permanently added the RSA host key for IP address '192.0.2.144' to the list of known hosts.
debug1: ssh_rsa_verify: signature correct
...
SSH sa che il mio host è valido (Vedi Host 'nms.example.org' is known and matches the RSA host key:) quindi perché aggiunge la chiave per l'IP a un profilo utente?
Questo è estremamente irritante, perché quando reinstallo una macchina, il mio sistema di gestione della configurazione gestisce correttamente la raccolta e la distribuzione delle chiavi host su tutto il sistema. Tuttavia, rimarranno queste chiavi in conflitto associate agli IP nei file host_host per uso che causano avvisi in un tentativo di connessione che impedisce la connessione degli script.
$ ssh nms -v
OpenSSH_6.0p1 Debian-4+deb7u4, OpenSSL 1.0.1e 11 Feb 2013
...
debug1: Local version string SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u4
debug1: using hostkeyalias: nms.example.org
...
debug1: Server host key: RSA 6b:5f:b6:e9:13:c3:b7:39:1e:ec:74:05:33:64:4d:5e
debug1: using hostkeyalias: nms.example.org
debug1: Host 'nms.example.org' is known and matches the RSA host key.
debug1: Found key in /etc/ssh/ssh_known_hosts:104
Warning: the RSA host key for 'nms.example.org' differs from the key for the IP address '192.0.2.144'
Offending key for IP in /home/zoredache/.ssh/known_hosts:25
Matching host key in /etc/ssh/ssh_known_hosts:104
Are you sure you want to continue connecting (yes/no)?
Come posso impedire a ssh di memorizzare nella cache questo valore per IP in ciascun utente known_hosts? O c'è qualche motivo di sicurezza per cui devo solo convivere con questo comportamento fastidioso? Questo mi frustra anche perché un paio di server hanno indirizzi IP piuttosto dinamici. La mia gestione della configurazione gestisce gli aggiornamenti DNS. Ma ricevo queste chiavi host per IP che riempiono i miei file host_host per utente.