ssh-keyscan
Get the public ssh keys of remote hosts. More information: https://man.openbsd.org/ssh-keyscan.
-
Retrieve all public ssh keys of a remote host:
ssh-keyscan {{host}}
-
Retrieve all public ssh keys of a remote host listening on a specific port:
ssh-keyscan -p {{port}} {{host}}
-
Retrieve certain types of public ssh keys of a remote host:
ssh-keyscan -t {{rsa,dsa,ecdsa,ed25519}} {{host}}
-
Manually update the ssh known_hosts file with the fingerprint of a given host:
ssh-keyscan -H {{host}} >> ~/.ssh/known_hosts
License and Disclaimer
The content on this page is copyright © 2014—present the tldr-pages team and contributors.This page is used with permission under Creative Commons Attribution 4.0 International License.
While we do attempt to make sure content is accurate, there isn't a warranty of any kind.