[ACCEPTED]-how to check if a host is in your known_host ssh-expect
Accepted answer
Try: ssh-keygen -F <hostname>
Will show the known_hosts
line(s) if the hostname 3 fingerprint is found and the command returns 2 0
, otherwise nothing is shown and the command 1 returns 1
.
According to ssh-keygen(1) man page
-F hostname 6 Search for the specified hostname in a 5 known_hosts file, listing any occurrences 4 found. This option is useful to find hashed host 3 names or addresses and may also be used 2 in conjunction with the -H option to 1 print found keys in a hashed format.
Source:
stackoverflow.com
More Related questions
Cookie Warning
We use cookies to improve the performance of the site. By staying on our site, you agree to the terms of use of cookies.