1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-06-08 09:46:01 +02:00
tldr/pages/common/ssh-keyscan.md
2025-06-04 22:32:46 +05:30

20 lines
569 B
Markdown

# 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 {{hostname}}`
- Retrieve all public SSH keys of a remote host listening on a specific port:
`ssh-keyscan -p {{port}} {{hostname}}`
- Retrieve certain types of public SSH keys of a remote host:
`ssh-keyscan -t {{rsa,dsa,ecdsa,ed25519}} {{hostname}}`
- Manually update the SSH known_hosts file with the fingerprint of a given host:
`ssh-keyscan -H {{hostname}} >> ~/.ssh/known_hosts`