SSH Certificates vs. Static Keys: Safer Server Access
An SSH certificate is a CA-signed public-key credential, not an identity token: the client must prove it holds the matching private key. Expiry blocks new logins with that certificate but does not end active sessions. To revoke a certificate early, distribute an updated OpenSSH key revocation list (KRL) to every server that should reject it.

What changes when you switch to SSH certificates?

A forgotten authorized_keys entry retains whatever access the associated account and key options allow. That might be a single forced command or an interactive account with sudo privileges. The problem is knowing where the key still works and whether anyone still needs it.
An OpenSSH user certificate binds a public key to signed principals and a validity window. The signing service authenticates the requester and decides which principals it may issue. At login, the client proves possession of the matching private key. The server’s sshd verifies the certificate against a trusted CA and checks its validity, the principal, the target account, and applicable access policy. In the example below, the deploy principal matches the deploy account. A valid signature alone is not enough.
Static keys vs. SSH certificates
| Decision | Static authorized_keys entries | OpenSSH user certificates |
|---|---|---|
| Lifetime | No expiry by default; set an expiry-time restriction per entry on supported versions. | The signer sets a validity window; expiry blocks new logins, not active sessions. |
| Early revocation | Remove the entry from every authorization source that permits it. | Update an OpenSSH KRL and distribute it to every relevant server configured with RevokedKeys. Handle active sessions separately. |
| Distribution | Manage user public keys wherever they are authorized. | Distribute CA public trust keys and revocation updates instead of individual user keys. |
| Audit trail | Track key ownership and changes; review server login logs. | Issuance logging depends on the signing service; server logs show whether a login occurred. |
| Theft impact | A stolen private key can authenticate wherever it remains authorized. | A stolen certificate alone cannot authenticate. Theft of both files allows attempts while the certificate is valid and unrevoked, subject to server policy. |
Illustrative Scenario: At a loaded labor rate of $90/hour, cutting key administration from four hours to one hour per month saves $270 monthly. A 12-hour setup costs $1,080 in staff time, putting simple payback at four months before signer hosting, maintenance, or on-call costs. Measure your own workload: well-managed static keys may be simpler if access rarely changes.
Stage a certificate-only login test
Use a staging host with an existing non-root deploy account. Keep a working admin session open and confirm an independent recovery path, such as the provider console. Record the previous configuration. Use a dedicated test key that has no static authorization on the server, including through any AuthorizedKeysCommand source.
On the client, create the test key. On a restricted signing machine, create a separate staging CA and sign a copy of the client’s public key:
# Client
ssh-keygen -t ed25519 -f ./staging_deploy -C 'staging deploy test'
# Signer: run after transferring staging_deploy.pub here
ssh-keygen -t ed25519 -f ./staging_user_ca -C 'staging SSH user CA'
ssh-keygen -s ./staging_user_ca -I staging-deploy-1001 -z 1001 \
-n deploy -V +5m ./staging_deploy.pubProtect both private keys with passphrases. Install only staging_user_ca.pub on the staging server as /etc/ssh/trusted-user-ca-keys.pub, managed by root. Add this directive in the global section of sshd_config:
TrustedUserCAKeys /etc/ssh/trusted-user-ca-keys.pubRun sudo sshd -t before reloading the SSH service. If validation fails, do not reload. Return staging_deploy-cert.pub to the client beside staging_deploy, then run the following, replacing staging.example.com with your staging hostname:
ssh-keygen -L -f ./staging_deploy-cert.pub
ssh -o IdentitiesOnly=yes -o PreferredAuthentications=publickey \
-i ./staging_deploy deploy@staging.example.comConfirm the server logs show certificate authentication. After the recorded expiry, with client and server clocks synchronized, retry from a fresh connection and confirm it fails. If your client multiplexes SSH, add -o ControlPath=none to both tests so neither reuses an existing connection.
Test early revocation and plan rollback
Issue a second test certificate with a new serial and enough validity to finish the test. Confirm it works, then create a staging KRL from that certificate with ssh-keygen -k -f ./revoked.krl ./staging_deploy-cert.pub. To add later revocations to an existing KRL, use ssh-keygen -k -u -f ./revoked.krl ./staging_deploy-cert.pub with the certificate you intend to revoke. Preserve earlier entries and use unique serials for each CA.
Deploy the KRL atomically through configuration management as a root-managed, readable file. After the file is in place, add RevokedKeys /etc/ssh/revoked.krl to the global configuration, validate with sudo sshd -t, and reload. Verify that a fresh login with the revoked, still-valid certificate fails and an unrevoked one succeeds. A missing or unreadable revocation file can block public-key authentication, so monitor distribution and test both outcomes.
If access breaks, use the open admin session or console to restore the last working configuration and readable revocation file without dropping required revocations. Validate, reload, and prove fresh admin access before closing the recovery session. Rehearse this in staging before changing production access controls or rotating CA keys.
Production rollout checklist
- Constrain issuance. Smallstep
step-casupports Okta through an OIDC provisioner. Configure and test principal restrictions rather than treating successful SSO as permission to use any Unix account. Log requester identity, principals, serial, and validity; check that issuance records can be matched to server logins. - Limit CA exposure. Keep the signing key off target hosts and separate staging and production trust. A compromised user CA threatens servers that trust it, subject to their account and access policies. Remove that CA from those servers during response and investigate active sessions separately.
- Separate user and host trust. User certificates authenticate users to servers. Host certificates authenticate servers to clients only when clients trust the host CA, for example through a hostname-scoped
@cert-authorityentry inknown_hosts. - Retire old paths gradually. Inventory static authorizations, migrate in batches, and verify both certificate access and independent recovery before removing legacy keys.
Frequently Asked Questions
What happens if the SSH CA goes offline?
If the CA is offline, users cannot get *new* certificates. However, users with existing, unexpired certificates can still log in to servers. This is why having a 'break-glass' static key stored in a physical safe or a secondary emergency access method is critical for availability.
Do SSH certificates work with standard SSH clients?
Yes, OpenSSH has natively supported certificates since version 5.4 (released in 2010). Most modern clients, including PuTTY and WinSCP, support them, though the command-line flags and configuration steps may vary slightly.
Can I revoke an SSH certificate before it expires?
Yes, but it requires a Key Revocation List (KRL). You must generate a KRL file containing the revoked certificate's serial number and distribute that file to all your servers. This is more complex than simply letting the certificate expire, which is why very short TTLs (e.g., 4-8 hours) are recommended.
Get the Weekly SMB AI & SaaS Brief
Practical software benchmarks, prompt templates, and ROI breakdowns delivered every Tuesday. No fluff, unsubscribe anytime.