Ask an engineering leader when their SSH keys were last rotated and you will usually get silence, then a guess, then an admission that the honest answer is never. Not because anyone decided rotation was unnecessary, but because nothing ever forced it and doing it by hand was risky enough to keep deferring. The keys that let people and automation into production have, in most organizations, been sitting unchanged since the day they were created, which for some of them was a very long time ago.
This is a narrow problem with an outsized consequence. A TLS certificate expires and forces a renewal, so a TLS estate cannot accumulate decade-old credentials without someone noticing. An SSH key has no expiry, so it accumulates risk silently with every year it survives. A key created in 2015 by someone who has since changed teams twice, or left entirely, may still authenticate to production today, and nobody scheduled a review because nothing on the key ever came due.
This post is specifically about the rotation gap: why SSH keys do not get rotated, why that matters more the longer it goes on, and how to fix it, first by inventorying and attributing what you have, and ultimately by moving to short-lived SSH certificates so that rotation stops being a project and becomes the default.
Renewal Workload Explosion
300 certificates: annual renewals & engineer hours as lifespans shrink
8×
More renewals at 47 days vs 1 year
1,200 hrs
= 0.6 FTE doing nothing but renewals
Why Nobody Rotates SSH Keys
The reasons are operational, not technical. Rotation is entirely possible; it just never wins against the forces working against it.
There is no expiry, so there is no forcing function
The single biggest reason SSH keys do not get rotated is that nothing makes them. An SSH key works until someone deliberately replaces it. There is no expiry date, no renewal event, no automated reminder, no broken connection that signals “time to rotate.” Every other credential class that gets rotated gets rotated because something forces the issue. SSH keys have no such mechanism, so rotation depends entirely on human discipline, which does not survive contact with a busy quarter.
Rotation is manual and per-host
Rotating an SSH key is not one action. It means generating a new keypair, distributing the new public key to every host the old key could reach, confirming the new key works everywhere, and only then removing the old public key from every one of those hosts. Across a fleet of hundreds or thousands of machines, with authorized_keys files that have drifted independently, this is a careful, error-prone operation that nobody wants to perform during business hours.
Rotation is risky
Because rotation touches the very mechanism people use to log in, a mistake locks someone out. Remove the old key before the new one is confirmed everywhere, and an engineer or a critical automation job loses access at the wrong moment. The fear of causing an outage makes teams defer rotation indefinitely, which is rational in the moment and corrosive over time. The safest-feeling action is always to leave the working key alone.
No one owns the whole picture
Because authorized_keys files live on individual hosts with no central registry, no single person or system knows the full set of keys that exist or who they belong to. Rotation requires knowing what to rotate, and the knowledge is scattered. The absence of ownership means the absence of a plan, and the keys persist by default.
The Accumulated Risk of Decade-Old Keys
The rotation gap would be a minor hygiene issue if keys aged gracefully. They do not. Risk compounds the longer a key survives.
Keys outlive the people and reasons they were created for
A key created for a specific engineer, a specific project, or a specific automation job long outlives the context that justified it. The engineer changes roles, the project ends, the automation is decommissioned, but the key keeps working. Over years, the population of keys drifts from “access that is currently justified” toward “access that merely still exists,” and the gap between those two is pure risk.
Copies proliferate over time
A private key that has existed for years has had time to spread. It has been copied to backup laptops, checked into old repositories, embedded in configuration management, pasted into runbooks, and stored in places no one tracks. A key created yesterday has had little opportunity to leak; a key created eight years ago has had thousands of opportunities. Age is a direct proxy for exposure.
| Key age | Likelihood of orphaned attribution | Likelihood of copies in uncontrolled locations | Rotation ever performed |
|---|---|---|---|
| Under 1 year | Low | Low | Rare |
| 1 to 3 years | Moderate | Moderate | Very rare |
| 3 to 7 years | High | High | Almost never |
| Over 7 years | Very high | Very high | Effectively never |
The blast radius is unknown
Because nobody knows exactly where an old key is accepted or who holds the private half, the consequence of that key being compromised is unknowable in advance. An unknown blast radius is impossible to insure against, and it is the defining property of an SSH estate that has never been rotated. You cannot bound a risk you cannot measure.
How to Fix It: Inventory, Attribute, Rotate
The way out is a sequence. You cannot rotate what you have not inventoried, and you should not rotate what you cannot attribute, because blind rotation reintroduces the outage risk that caused the deferral in the first place.
Inventory every key across the fleet
Start by collecting every public key present in every authorized_keys file across every host, along with where each one is accepted. This is the central registry that never existed. The output is a single view of the real access surface: which keys exist, and on which hosts each one grants entry. Until this exists, every rotation decision is a guess.
Attribute each key to an owner
For each key in the inventory, answer who holds the private half and why they have access. Some keys map cleanly to current employees or active automation. Others map to former employees, decommissioned services, or nobody identifiable at all. That last category, the keys you cannot attribute, is both the highest risk and the safest to remove, because by definition no current, justified user depends on them.
Remove the orphans first, then rotate the rest
Removing unattributable keys is the fastest risk reduction available, and it carries little outage risk precisely because nothing legitimate depends on them. Once the orphans are gone, rotate the attributed keys deliberately: issue new keys, confirm they work everywhere the old key was accepted, then retire the old key. This is still manual work, but it is now bounded by a real inventory rather than open-ended, and it clears the backlog of accumulated risk.
Do not stop at a one-time cleanup
A one-time rotation resets the clock but does not change the dynamics. Without a forcing function, the newly rotated keys will begin aging the same way the old ones did, and in a few years you will be back where you started. The cleanup is necessary, but it is not the fix. The fix is removing the reason rotation is manual and optional in the first place.
The Real Fix: Short-Lived Certificates So Rotation Is Automatic
The durable solution is to stop relying on keys that must be rotated by hand and move to SSH certificates that expire on their own. This changes rotation from an action someone must remember to perform into a property of the system.
Expiry makes rotation continuous instead of episodic
A short-lived SSH certificate is valid for hours. The credential a user presents today is not the credential they present tomorrow, because today’s expired overnight and a fresh one was issued. Rotation is no longer a project you schedule; it happens on every issuance, automatically, for everyone. The forcing function that raw keys never had is built into the credential’s lifetime.
There is nothing long-lived left to orphan
Because the credential expires on its own, there is no persistent private key accumulating copies and outliving its purpose. When access should end, issuance simply stops, and the last certificate expires within hours. The entire category of decade-old orphaned keys cannot form, because no credential lives long enough to become one.
Central issuance gives you the ownership you were missing
With certificates issued by a central authority tied to identity, the registry and attribution you had to reconstruct by hand come for free. Every certificate issued is a logged event bound to a verified identity. You always know who was granted access and when, because the system recorded it at issuance rather than leaving it scattered across authorized_keys files.
The migration path reuses the inventory work
The inventory and attribution you did to clean up the old keys is exactly what you need to migrate to certificates. The attributed access maps to issuance policy: the people and automation that legitimately needed those keys become the identities that receive certificates. Hosts are configured to trust the certificate authority, legacy keys stay in place during the transition as a fallback, and once certificate access is proven for a population, their old keys are drained. The one-time cleanup and the permanent fix are the same project, sequenced correctly.
Sequencing the Work
Put the pieces in an order that reduces risk at every step and does not depend on a flag day.
- Inventory every key and where it is accepted, producing the central registry that does not exist today.
- Attribute each key to a current owner and justification, flagging the ones you cannot.
- Remove unattributable keys first, the fastest and safest risk reduction.
- Stand up an SSH certificate authority and configure hosts to trust it alongside existing keys.
- Issue short-lived certificates to the attributed population, tied to identity, with legacy keys as fallback.
- Drain legacy keys once certificate access is confirmed, ending with an estate where rotation is automatic and orphaned keys cannot accumulate.
Each step stands on the previous one, and the access path keeps working throughout, which is what makes it safe to run against production.
FAQ
Q: Why not just set a policy requiring annual SSH key rotation? Because a policy without a forcing function does not survive operational pressure. SSH keys have no expiry, so an annual rotation policy relies entirely on humans performing risky, manual, per-host work on schedule, and that discipline erodes under deadlines. Policies that depend on remembering to do painful manual work tend to lapse quietly; the durable fix is to make the credential expire on its own so rotation is not optional.
Q: Is a one-time key cleanup worth doing if we are going to move to certificates anyway? Yes, because the inventory and attribution are prerequisites for both. You cannot migrate access you have not mapped, and the attribution work tells you which identities should receive certificates. Removing orphaned keys also reduces risk immediately, before the certificate migration completes. The cleanup and the migration are the same project; the cleanup is the first half, not wasted effort.
Q: How do short-lived certificates avoid locking people out, given rotation risk? The issuance happens automatically and ahead of expiry, so users and automation always have a fresh, valid certificate without manual intervention. The outage risk in manual key rotation comes from removing the old credential before the new one is confirmed everywhere; with certificates, the authority issues the next credential continuously and hosts trust the authority rather than individual keys, so there is no per-host removal step to get wrong.
Q: What about automation and service accounts that log in constantly? Automation requests certificates on a schedule that refreshes before expiry, the same way users do, so a long-running job always holds a valid short-lived certificate and never a permanent key. This removes the service-account keys that are often the oldest and most widely copied credentials in an estate. The automation proves its identity to the issuing authority and receives a time-boxed credential, so even machine access rotates automatically.
Q: How long does it take to inventory an SSH estate that has never been reviewed? It depends on fleet size and how scattered the authorized_keys files are, but the inventory itself is mechanical once you can reach every host: collect the keys, record where each is accepted, and correlate fingerprints. The slower part is usually attribution, because mapping old keys back to owners requires institutional knowledge that may have left with the people who created them. That difficulty is itself evidence of the risk, and the unattributable remainder is where you focus first.
About QCecuring
QCecuring helps enterprises close the SSH key rotation gap, first by inventorying and attributing the keys scattered across their fleet, then by moving access to short-lived certificates so rotation becomes automatic. The decade-old orphaned keys stop accumulating, because no credential lives long enough to become one.
Close your SSH key rotation gap
Tags: SSH Key Management, Enterprise Security, Key Rotation, SSH Certificates, Certificate Authority, Short-Lived Credentials, Orphaned Keys, Inventory, Attribution, Offboarding, Credential Hygiene, Zero Trust