En algunas ocasiones, si cambiamos las direcciones IP de los equipos de nuestra red, podemos encontrarnos con el problema de que a la hora de intentar acceder por SSH a alguno de nuestros HOSTS nos lance un error similar a este:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the RSA key sent by the remote host is '6b:14:7d:5c:01:14:b4:5f:17:69:5a:e1:99:78:81:7c.' Please contact your system administrator. Add correct host key in /root/.ssh/known_hosts to get rid of this message. Offending RSA key in /root/.ssh/known_hosts:2 RSA host key for 'X.x.X.x' has changed and you have requested strict checking. Host key verification failed.
En este caso, tal y como explica en el propio error, debemos modificar el fichero /root/.ssh/known_hosts
|1|cZEna12YUmp+eHTsdf2q+spM=|MB6Ltfdsdf234Da3a+h9cujPkzDg= ssh-rsa AAAAB3NzaC1yc2EAA3423fQABAAAAgwCKFG+urL0moyI
Como solo tenía 2 entradas y se que la última corresponde al HOST que quiero eliminar. Simplemente borro dicha linea.
Intentamos de nuevo el acceso y nos pregunta que si queremos añadir la nueva RSA KEY, escribimos YES y nos añade el nuevo HOST a la lista de dispositivos conocidos o known_hosts. Ya podemos seguir trabajando con normalidad.
root@jeffri: # ssh root@X.x.X.x The authenticity of host 'X.x.X.x (X.x.X.x)' can't be established. RSA key fingerprint is 83:d0:fd:37:1b:45:7b:25:6c:cd:98:26:96:65:e4:84. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added 'X.x.X.x' (RSA) to the list of known hosts.