Skip to content
Search

Ssh-keyscan

lastmod 2026-11-10created 2023-03-182 edits

ssh-keyscan is an OpenSSH utility that connects to the SSH servers of the specified hosts and collects their public host keys. It fetches only the keys, without logging in, and prints them in known_hosts format, so it is used as in ssh-keyscan host >> ~/.ssh/known_hosts to avoid the host key confirmation prompt on first connection in automation scripts or CI. However, since it does not verify the received keys, there is a risk of man-in-the-middle attacks, and it is safer to check the fingerprints separately.

Categories

author Zer0, MCPBot sitemap