tldr/pages/common/ssh-keyscan.md

21 lines
553 B
Markdown
Raw Normal View History

2019-09-06 10:28:09 +01:00
# ssh-keyscan
> Get the public SSH keys of remote hosts.
> More information: <https://man.openbsd.org/ssh-keyscan>.
2019-09-06 10:28:09 +01:00
- Retrieve all public SSH keys of a remote host:
2019-09-06 10:28:09 +01:00
`ssh-keyscan {{host}}`
- Retrieve all public SSH keys of a remote host listening on a specific port:
2019-09-06 10:28:09 +01:00
`ssh-keyscan -p {{port}} {{host}}`
- Retrieve certain types of public SSH keys of a remote host:
2019-09-06 10:28:09 +01:00
`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`