Forrest logo
tool overview
On this page you find all important commands for the CLI tool ssh-keyscan. If the command you are looking for is missing please ask our AI.

ssh-keyscan

ssh-keyscan is a utility for gathering the public ssh host keys of a number of hosts. It was designed to aid in building and verifying ssh_known_hosts files. ssh-keyscan provides a minimal interface suitable for use by shell and perl scripts.

List of commands for ssh-keyscan:

  • ssh:tldr:3f002 ssh: Retrieve all public ssh keys of a remote host.
    $ ssh-keyscan ${host}
    try on your machine
    explain this command
  • ssh:tldr:49e87 ssh: Retrieve certain types of public ssh keys of a remote host.
    $ ssh-keyscan -t ${rsa,dsa,ecdsa,ed25519} ${host}
    try on your machine
    explain this command
  • ssh:tldr:78f8e ssh: Manually update the ssh known_hosts file with the fingerprint of a given host.
    $ ssh-keyscan -H ${host} >> ~/.ssh/known_hosts
    try on your machine
    explain this command
  • ssh:tldr:e7804 ssh: Retrieve all public ssh keys of a remote host listening on a specific port.
    $ ssh-keyscan -p ${port} ${host}
    try on your machine
    explain this command
tool overview