Esto era novedad. He tenido que formatear un servidor y al intentar conectarme de nuevo desde otro servidor del que ya me conectaba antes recibo este error:
david@backups:~/.ssh$ ssh root@172.31.0.41
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
d4:22:66:d1:7a:83:e4:77:75:d0:e8:ec:52:d9:1d:aa.
Please contact your system administrator.
Add correct host key in /home/david/.ssh/known_hosts to get rid of this message.
Offending key in /home/david/.ssh/known_hosts:10
RSA host key for 172.31.0.41 has changed and you have requested strict checking.
Host key verification failed.
Claro, evidentemente la clave RSA había cambiado y no correspondía con la que había guardada en el fichero known_hosts y no era posible la conexión.
La solución la da el propio mensaje, la clave obsoleta se encontraba en la linea 10 de mi fichero known_host tal y como dice el mensaje de error.
Eliminamos la huella antigua con el siguiente comando:
$ sed -i 10d ~/.ssh/known_hosts
Notese que en el comando he puesto que borrase la linea 10. Y ya puedo conectarme de nuevo ya que ofrece la nueva huella de la nueva identidad del servidor nuevo.
En caso de querer añadir de nuevo la clave publica al nuevo servidor tan solo hemos de ejecutar el siguiente comando:
david@backups$ cat ~/.ssh/id_rsa.pub | ssh root@172.31.0.41 ‘cat – >> ~/.ssh/authorized_keys’
Comentarios Recientes