Nms.example.org adında bir sunucum var. Benim /etc/ssh/ssh_known_hostsRSA anahtarı ile ana bilgisayar için bir giriş var. Bu girdi ve diğer tüm girdiler yapılandırma yönetim sistemim tarafından yönetiliyor.
nms.example.org ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZqfmVPs/XqTS...
Ayrıca /etc/ssh/ssh_configbelirli bir ana bilgisayar için ana anahtar takma ad ayarlama bir giriş var . Hangi her şeyi doğru anlarsam, bu sadece önemli nms.example.orgolması gerektiği anlamına gelir .
Host nms.example.org nms.example nms
HostKeyAlias nms.example.org
HostName nms.example.org
Neden o zaman, bir istemciden bağlandığımda ssh hala ana bilgisayar IP ile kullanıcı başına bilinen_hosts için bir anahtar eklemek gerektiğini düşünüyor görünüyor ?
$ 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, sunucumun geçerli olduğunu biliyor (Bkz Host 'nms.example.org' is known and matches the RSA host key:), neden IP anahtarını bir kullanıcı profiline ekliyor?
Bu son derece rahatsız edici, çünkü bir makineyi yeniden yüklediğimde, konfigürasyon yönetim sistemim ana bilgisayar anahtarlarını toplayıp tüm sisteme dağıtmayı gayet iyi yapıyor. Ancak, komut dosyalarının bağlanmasını engelleyen bir bağlantı denemesinde uyarılara neden olan kullanım başına bilinen bilinen_host dosyalarındaki IP'lerle ilişkili çakışan anahtarlar kalmayacaktır.
$ 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)?
Ssh'nin bilinen her kullanıcıda bu IP başına değeri önbelleğe almasını nasıl önleyebilirim? Yoksa bu sinir bozucu davranışla yaşamamın bir güvenlik nedeni var mı? Bu da beni sinirlendiriyor çünkü birkaç sunucunun biraz dinamik IP adresleri var. Yapılandırma yönetimim DNS güncellemelerini yönetiyor. Ancak bu kullanıcı başına bilinen host_host dosyalarımı dolduran IP başına ana bilgisayar anahtarları bırakıyorum.