Where to start First steps track · 15 stages
Linux Labs

ssh-keyscan — collecting host keys

cheat sheet · OpenSSH 9.6 https://lab.dimsanych.ru/en/wiki/ssh-keyscan/

Cheat sheet

  • ssh-keyscan server.example.com the host's public keys (to stdout)
  • ssh-keyscan -H server.example.com >> ~/.ssh/known_hosts add, hashing the hostname
  • ssh-keyscan -t ed25519 server.example.com only one key type
  • ssh-keyscan -p 2222 server.example.com non-standard port
  • ssh-keyscan -f hosts.txt a list of hosts from a file
  • ssh-keygen -lf <(ssh-keyscan server.example.com 2>/dev/null) fingerprints to verify

Options

Below are the main flags; the full list is in man ssh-keyscan.

Loading…