ssh-known-hosts

Demo · format-valid IANA · provisional

/.well-known/ssh-known-hosts

Standard: C2SP well-known-ssh-hosts

Publish your SSH host keys over HTTPS so clients can verify before first connect (TOFU upgrade).

What it is

A service publishes its sshd known_hosts entries at /.well-known/ssh-known-hosts. SSH clients can fetch it over HTTPS to verify a host key before trusting it — turning trust-on-first-use into verified-on-first-use.

The threat it addresses

SSH's default trust-on-first-use (TOFU) is vulnerable to a MITM on the very first connection. Publishing keys over authenticated HTTPS closes that gap for domains whose web TLS is already trusted.

How it works

  • The file is a restricted subset of the sshd known_hosts format: plain hostnames (matching the serving domain or subdomains), valid base64 keys.
  • Clients that support the spec fetch the file, verify the key matches, then connect.
  • The HTTPS certificate is the trust anchor — same model as SSHFP but without DNS dependency.

Honesty notes

  • Demo: format demonstration only — no SSH service runs on this host.

Try it

Live demo

Format demonstration — no SSH service runs on this host

Content-Type: text/plain; charset=utf-8
# /.well-known/ssh-known-hosts (C2SP) — demo file
# A real deployment publishes the sshd known_hosts lines for its SSH service,
# e.g.:  ssh.example.com ssh-ed25519 AAAA...
# No SSH service runs on this host; this file demonstrates the format.