Un ejemplo es cuando accedemos a una máquina por ssh y nos da el siguiente warning
mgomezg07@aN32-pro:/root$ ssh root@ldap @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 34:94:86:c9:55:10:7e:63:dc:6f:91:32:e4:73:3d:ce. Please contact your system administrator. Add correct host key in /home/profesor/mgomezg07/.ssh/known_hosts to get rid of this message. Offending key in /home/profesor/mgomezg07/.ssh/known_hosts:3 RSA host key for ldap has changed and you have requested strict checking. Host key verification failed. mgomezg07@aN32-pro:/root$Como vemos no podemos acceder porque nos dice que en fichero /home/profesor/mgomezg07/.ssh/known_hosts:3 ha habido algún cambio, nos indica que ha sido en la linea 3 por lo que podemos hacer lo siguiente.
# borrar la línea 3 del archivo '~/.ssh/known_hosts' sed -i '3 d' ~/.ssh/known_hosts # o también sed -i 3d ~/.ssh/known_hosts # borrar algunas líneas: # borrar 6 líneas a partir de la línea 3 sed -i 3,+6d file.txt # borrar la línea donde se encuentre el texto 'TO DELETE' sed -i '/TO DELETE/ d' file.txtEl símbolo de ~ es el directorio del usuario actual y se saca con el Alt Gr + 4 y de esta forma no tenemos que poner el directorio completo
No hay comentarios:
Publicar un comentario