lunes, 16 de enero de 2012

Cómo borrar una clave SSH del know_hosts

Muchas veces cuando trabajamos con máquinas virtuales o IPs dinámicas nos aparece el siguiente error al intentar acceder a una de ellas por SSH:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
db:eb:ea:b9:97:4b:7f:6a:f3:a9:f3:af:1b:04:7f:45.
Please contact your system administrator.
Add correct host key in /home/user/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/user/.ssh/known_hosts:26
RSA host key for 192.168.191.128 has changed and you have requested strict checking.
Host key verification failed.


Si estamos seguros que es el cambio en la clave SSH del servidor al que intentamos acceder se debe a causas "normales" podemos eliminar la entrada que nos estorba con el siguiente comando:

ssh-keygen -R 192.168.191.128

A continuación intentaremos acceder de nuevo y aceptaremos la nueva clave del servidor.

No hay comentarios:

Publicar un comentario