Pregunta:
Me gustaría ver qué hosts hay en mi archivo known_hosts pero no parece ser legible por humanos. ¿Es posible leerlo?
Más específicamente, hay un host al que puedo conectarme a través de varios nombres y quiero averiguar cuál es la huella digital que espero de mi archivo de hosts conocidos.
Actualización: estoy usando OpenSSH_5.3p1 Debian-3ubuntu7, OpenSSL 0.9.8k 25 de marzo de 2009
Una línea de mi archivo known_hosts se parece a esto,
|1|guO7PbLLb5FWIpxNZHF03ESTTKg=|r002DA8L2JUYRVykUh7jcVUHeYE= ssh-rsa AAAAB3NzaC1yc2EAAFADAQABAAABAQDWp73ulfigmbbzif051okmDMh5yZt/DlZnsx3DEOYHu3Nu/+THJnUAfkfEc1XkOFiFgbUyK/08Ty0K6ExUaffb1ERfXXyyp63rpCTHOPonSrnK7adl7YoPDd4BcIUZd1Dk7HtuShMmuk4l83X623cr9exbfm+DRaeyFNMFSEkMzztBYIkhpA2DWlDkd90OfVAvyoOrJPxztmIZR82qu/5t2z58sJ6Jm2xdp2ckySgXulq6S4k+hnnGuz2p1klviYCWGJMZfyAB+V+MTjGGD/cj0SkL5v/sa/Fie1zcv1SLs466x3H0kMllz6gAk0/FMi7eULspwnIp65g45qUAL3Oj
Respuesta:
Tiene HashKnownHosts
configurado en " yes
" en su archivo ssh_config
, por lo que los nombres de host no están disponibles en texto plano.
Si conoce el nombre de host que está buscando con anticipación, puede buscarlo con:
ssh-keygen -H -F hostname
# Or, if SSH runs on port other than 22
ssh-keygen -H -F '[hostname]:2222'
Aquí está la sección relevante de la página de manual de ssh-keygen(1)
:
-F hostname
Search for the specified hostname in a known_hosts file, listing
any occurrences found. This option is useful to find hashed host
names or addresses and may also be used in conjunction with the
-H option to print found keys in a hashed format.