Remover entrada de nombre de servidor o ip del archivo known_hosts

En alguna ocasión, hubo que migrar la información de una máquina a otra.

Una vez migrada, cuando trataba de conectarme vía ssh, me generaba el siguiente error

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
┌─[13:24:34] [dll ~/prueba]
└─> ¯\_(ツ)_/¯ssh root@192.168.248.17
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
65:73:16:28:83:b5:26:e2:df:33:2e:2f:f5:4e:cc:48.
Please contact your system administrator.
Add correct host key in /home/pad/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/pad/.ssh/known_hosts:50
RSA host key for 192.168.248.17 has changed and you have requested strict checking.
Host key verification failed.
┌─[13:24:37] [dll ~/prueba]
┌─[13:24:34] [dll ~/prueba] └─> ¯\_(ツ)_/¯ssh root@192.168.248.17 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 65:73:16:28:83:b5:26:e2:df:33:2e:2f:f5:4e:cc:48. Please contact your system administrator. Add correct host key in /home/pad/.ssh/known_hosts to get rid of this message. Offending RSA key in /home/pad/.ssh/known_hosts:50 RSA host key for 192.168.248.17 has changed and you have requested strict checking. Host key verification failed. ┌─[13:24:37] [dll ~/prueba]
┌─[13:24:34] [dll ~/prueba]
└─> ¯\_(ツ)_/¯ssh root@192.168.248.17
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
65:73:16:28:83:b5:26:e2:df:33:2e:2f:f5:4e:cc:48.
Please contact your system administrator.
Add correct host key in /home/pad/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/pad/.ssh/known_hosts:50
RSA host key for 192.168.248.17 has changed and you have requested strict checking.
Host key verification failed.
┌─[13:24:37] [dll ~/prueba]

Para resolver este tema y podernos conectar a la máquina nuevamente, procedemos a eliminar la entrada en el archivo known_hosts que se encuentra en el directorio .ssh del usuario que ejecuta la orden ssh.

Lo haremos de la siguiente manera.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
┌─[13:25:25] [dll ~/prueba]
└─> ¯\_(ツ)_/¯ssh-keygen -R 192.168.248.17
# Host 192.168.248.17 found: line 50 type RSA
/home/pad/.ssh/known_hosts updated.
Original contents retained as /home/pad/.ssh/known_hosts.old
┌─[13:25:33] [dll ~/prueba]
┌─[13:25:25] [dll ~/prueba] └─> ¯\_(ツ)_/¯ssh-keygen -R 192.168.248.17 # Host 192.168.248.17 found: line 50 type RSA /home/pad/.ssh/known_hosts updated. Original contents retained as /home/pad/.ssh/known_hosts.old ┌─[13:25:33] [dll ~/prueba]
┌─[13:25:25] [dll ~/prueba]
└─> ¯\_(ツ)_/¯ssh-keygen -R 192.168.248.17
# Host 192.168.248.17 found: line 50 type RSA
/home/pad/.ssh/known_hosts updated.
Original contents retained as /home/pad/.ssh/known_hosts.old
┌─[13:25:33] [dll ~/prueba]

De esta forma procedemos a conectarnos nuevamente y ya no nos aparecerá dicho mensaje de error.

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
┌─[13:26:11] [dll ~/prueba]
└─> ¯\_(ツ)_/¯ssh root@192.168.248.17
The authenticity of host '192.168.248.17 (192.168.248.17)' can't be established.
RSA key fingerprint is 65:73:16:28:83:b5:26:e2:df:33:2e:2f:f5:4e:cc:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.248.17' (RSA) to the list of known hosts.
root@192.168.248.17's password:
┌─[13:26:11] [dll ~/prueba] └─> ¯\_(ツ)_/¯ssh root@192.168.248.17 The authenticity of host '192.168.248.17 (192.168.248.17)' can't be established. RSA key fingerprint is 65:73:16:28:83:b5:26:e2:df:33:2e:2f:f5:4e:cc:48. Are you sure you want to continue connecting (yes/no)? yes Warning: Permanently added '192.168.248.17' (RSA) to the list of known hosts. root@192.168.248.17's password:
┌─[13:26:11] [dll ~/prueba]
└─> ¯\_(ツ)_/¯ssh root@192.168.248.17
The authenticity of host '192.168.248.17 (192.168.248.17)' can't be established.
RSA key fingerprint is 65:73:16:28:83:b5:26:e2:df:33:2e:2f:f5:4e:cc:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.248.17' (RSA) to the list of known hosts.
root@192.168.248.17's password: 

Y eso es todo…..

 

Sin respuestas

Deja un comentario