ssh-keyscan -t ed25519 example.com

Category: Security & Hardening

ssh-keyscan -t ed25519 example.com

Fetch a host's SSH public keys

Queries example.com for its SSH host keys and prints them, the raw material for pre-populating known_hosts. Pinning the key before the first connection prevents man-in-the-middle attacks. Append the output to ~/.ssh/known_hosts to trust the host, or compare it with the fingerprint shown on the server.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.