Strovent SystemsSign in
Reference

Check which CA signed an SSH certificate, and revoke a certificate with a KRL

Read an OpenSSH user certificate with ssh-keygen -L, compare its Signing CA with the CA key the server trusts, and revoke a certificate by serial or key ID.

An OpenSSH user certificate is a public key signed by a certificate authority (CA). A server accepts it when the signing CA is one it trusts, the user is in the certificate's principals and the certificate is still valid. This page shows how to check those points and how to revoke a certificate before it expires. For what certificates are, see OpenSSH certificates.

Read a certificate

ssh-keygen -L -f id_ed25519-cert.pub

The output includes:

Type: [email protected] user certificate
Signing CA: ED25519 SHA256:LIfo...YiYu8 (using ssh-ed25519)
Key ID: "fred@example"
Serial: 7
Valid: from 2026-11-20T18:29:00 to 2027-11-19T18:30:39
Principals:
        fred
  • Type must say user certificate. A host certificate does not log you in.
  • Principals must include the user name you log in as.
  • Valid must include the current time on the server.

Check the signing CA

Print the fingerprint of the CA public key the server trusts. That is a key in the file named by TrustedUserCAKeys in sshd_config, or a cert-authority line in authorized_keys:

ssh-keygen -l -f ca.pub

The SHA256: value must be the same as the Signing CA line of the certificate. If it is different, the certificate was signed by another CA, and the server will not accept it.

Revoke a certificate

OpenSSH revokes keys and certificates with a Key Revocation List (KRL), a compact binary file made by ssh-keygen -k. To revoke by serial number or key ID, you do not need the certificate itself, only the CA public key. Write a specification file:

serial: 7
id: fred@example

Then build the KRL, naming the CA with -s:

ssh-keygen -k -f revoked.krl -s ca.pub spec.txt

To add to an existing KRL instead of replacing it, add -u. On each server, point sshd_config at the file and reload sshd:

RevokedKeys /etc/ssh/revoked.krl

The manual warns that if the RevokedKeys file cannot be read, public key authentication is refused for all users, so check its permissions.

To test whether a certificate is revoked:

ssh-keygen -Q -f revoked.krl id_ed25519-cert.pub

It prints REVOKED for a revoked certificate.

Sources

Spotted a mistake? Email [email protected].