Prompt
What should I use for rotating SSH keys and certificates?
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
For rotating SSH keys and certificates, the best choice depends on whether you want simple key rotation or centralized SSH certificate management.
Best practice: use SSH certificates, not long-lived raw keys
If you can, use:
- Short-lived SSH certificates
- A central SSH CA (certificate authority)
- Automated issuance and expiry
This is usually better than rotating individual ~/.ssh/id_* keys everywhere, because you can:
- issue short-lived access,
- revoke centrally,
- avoid distributing many public keys to servers,
- reduce the operational burden of frequent rotation.
Good tools/options
1. OpenSSH CA
Best if you want a native, lightweight solution.
- Built into OpenSSH
- Supports signing user and host certificates
- Works well with short-lived certs and SSH config
- Good choice if you manage your own infrastructure
Use this if:
- you already use SSH heavily,
- you want minimal extra infrastructure,
- you can manage a CA securely.
2. HashiCorp Vault SSH secrets engine
Best if you want dynamic, centrally managed SSH access.
- Issues SSH certificates on demand
- Can integrate with identity systems and policies
- Good for ephemeral access and auditability
Use this if:
- you already run Vault,
- you want centralized access control and auditing,
- you need strong automation.
3. Teleport
Best for larger environments or teams.
- Uses SSH certificates under the hood
- Supports SSO, MFA, audit logs, session recording
- Good for zero-trust-style access
Use this if:
- you want enterprise-grade access management,
- you need audit/compliance features,
- you have many users and systems.
4. Smallstep step-ca
Best if you want an easy CA for SSH and other certs.
- Simple to set up
- Issues SSH certificates
- Can also do TLS certificates
- Good developer-friendly option
Use this if:
- you want a modern CA with less complexity than Vault/Teleport,
- you need SSH certs plus other cert workflows.
If you only mean raw SSH key rotation
If you’re stuck with traditional SSH keys, use:
- Ansible / Puppet / Chef / Salt
- A script or CI job to:
- generate new key pairs,
- deploy new public keys,
- overlap old/new keys briefly,
- remove old keys after validation.
But this is less ideal than certs.
My recommendation
- For a small setup: OpenSSH CA or Smallstep
step-ca - For dynamic secrets / enterprise policy: Vault
- For team access, SSO, auditing, and session recording: Teleport
If you want, I can also give you:
- a simple OpenSSH CA setup,
- a Vault-based approach, or
- a recommended rotation workflow for raw SSH keys.