SSH host certificates¶
An SSH host certificate lets clients verify a server without "The
authenticity of host ... can't be established" prompts and without
known_hosts entries per server.
Before you start: the host key¶
The server's host keys already exist: sshd made them when it was
installed, in /etc/ssh/ssh_host_*_key (private) and
/etc/ssh/ssh_host_*_key.pub (public). BastionXP CA certifies one of them; it
does not make host keys. Check:
If they are missing (some minimal images), create the standard set:
Get one¶
The administrator. The names are the host names clients use:
On the server, for its existing host key:
The certificate is written to /etc/ssh/ssh_host_ed25519_key-cert.pub.
Host certificates are valid for 30 days by default (up to 90).
Server setup¶
Tell sshd to present it:
Client setup: trust the host CA¶
Add one line to ~/.ssh/known_hosts (or /etc/ssh/ssh_known_hosts for
every user), made of @cert-authority, the host names it applies to, and
the content of ssh_host_ca.pub:
Or let bxp trust add it:
Renew it¶
Host certificates renew with no token, using the host key as the proof. Run it from the hourly timer (a 30-day certificate renews with 10 days left, so daily is enough here, but one timer for all certificates is simpler):
sudo bxp renew --cert /etc/ssh/ssh_host_ed25519_key-cert.pub \
--key /etc/ssh/ssh_host_ed25519_key --exec "systemctl reload sshd"
The host key stays the same; only the certificate file is replaced. See Renew certificates.