← Back to section · Digital Security

Governing SSH Keys at Scale: From Key Sprawl to Full Lifecycle Management

Public-key authentication eliminated passwords but created a new governance problem: tens of thousands of public keys scattered across authorized_keys files, with nobody knowing the whole picture. This article discusses the causes of key sprawl, approaches to inventory and discovery, process design for rotation and offboarding revocation, and why short-lived certificates are the endpoint of this evolutionary path.

Published 22 November 2026 · 5 min read · PQ Frontier

Governing SSH Keys at Scale: From Key Sprawl to Full Lifecycle Management
AI-generated site artwork
Video explainer · SSH Security: Keys and Access Control

How Sprawl Happens

Every SSH public key is a pass that can be photocopied without limit, has no expiry date, and is registered with no central system. Generating one costs nothing (a single command), distributing one costs nothing (copying one line of text into authorized_keys), and using one is imperceptible (login logs scattered across machines). Those three properties decide it: once an organisation grows past the line where “one person can remember every machine,” key sprawl is inevitable.

Sprawl takes three typical forms. Orphan keys: the owner has left or changed roles, but the public key remains on dozens of machines; nobody knows the full list, and nobody dares delete — afraid of breaking some automation job still running. Shared keys: one private key circulates within a team, even gets committed into a code repository or baked into an image, killing accountability and revocation at the same time. Zombie authorisations: a public key added temporarily for a one-off troubleshooting session, never cleaned up afterwards, resident ever since.

All three share one trait: none involves any cryptographic weakness. They are purely inventory problems. An attacker who obtains any one unmanaged private key faces an open front door.

Inventory: A List First, Policy Second

The first step of governance is not writing policy but turning the current state into queryable data: periodically collect the authorized_keys of every machine in the fleet via configuration management or inspection scripts, correlate with HR systems and the asset register, and produce a mapping of “public key → which machines it appears on → presumed owner.” The moment that table exists, risk becomes concrete: how many public keys cannot be attributed, how many machines a single key spans, which accounts carry authorisations unused for years (judged against last-use times in authentication logs).

The inventory must also handle a grey zone: automation keys. Service keys held by backup, monitoring, and release systems often have no natural-person owner and can neither be deleted nor casually replaced. The correct handling is to register them separately — purpose and responsible person noted — and constrain them with sshd’s authorisation options: from= to restrict source, command= to restrict them to a single designated command, so that even a leaked service key can only do its own one job.

Rotation and Revocation: Wired into Processes, Not Memory

Key rotation is routine in the password world but chronically absent in the SSH world, for a practical reason: rotating means touching the client private key and the public keys on dozens of machines simultaneously, and manual operations inevitably err. The solution is to make rotation an idempotent configuration-management task: push the new public key everywhere first (old and new coexist), verify logins work, then uniformly remove the old key, with rollback possible throughout. The rotation period can be unaggressive (a year, say); what matters is that it is a pipeline, not a project.

Revocation must be hard-wired to HR processes: departure and role-change events originate in the HR system and automatically trigger a ticket and execution for “remove all of this employee’s public keys from all machines,” verified to zero against the inventory table. The criterion likewise comes from data: after revocation, the inventory should show no residue of that employee’s keys anywhere. Any step that requires “someone remembering to delete” should be treated, at process-design time, as non-existent.

The Endpoint: Keys That Expire by Themselves

Even with all the above governance done well, the residual cost is structural: authorisation exists in the form of “static lists,” so governance forever chases changes to the lists. Short-lived certificates change the form of existence — authorisation no longer sits on every machine but is concentrated in the CA’s issuance records; the pass carries an hours-long validity, so “revocation” changes from an action someone must execute into a fact that occurs when time passes; and “who can log into which machine” changes from a fleet-wide inventory problem into a query over issuance logs.

That is not to say static public keys should be abolished overnight: at small scale, a well-maintained inventory plus configuration management is entirely sufficient. But once machine and head counts cross a certain magnitude, the marginal cost of governance rises steeply, and certificates are the inflection point of that cost curve. To judge whether the inflection point has arrived, look at one metric only: can your organisation answer, completely and within one hour, “which machines can this private key enter?” If not, you are already past it.

The Private-Key Side: The Ignored Other Half of the Lifecycle

Inventory and revocation govern public keys (the server half), but the other half of the risk is private keys: scattered across employees’ laptops, backup drives, chat histories, and code repositories, their compromise leaves no trace in any server-side list. Private-side lifecycle discipline includes at least four rules: passphrases are mandatory at generation (the key file is ciphertext at rest, so a lost machine is not a lost credential); prefer hardware keys (the private key of an sk-ed25519 key on a FIDO2 security key cannot be exported, and physical presence becomes a condition of use); private keys never enter sync drives, code repositories, or ticket attachments, and those locations belong in secrets-scanning patrols; and workstation replacement and decommissioning processes must include the action “retire the old private key, register a new one,” rather than copying the whole .ssh directory to the new machine and calling it done.

The server side can, in turn, insure the private side: for high-value machines, enable two-person or two-factor combinations (public key plus one-time password), converge authentication sources by IP and bastion, and send anomalous successful authentications (unfamiliar source, unfamiliar hour) into alerting. Private-key governance done perfectly still cannot guarantee no compromise ever; server-side depth decides how far an attacker gets after one — the two halves of the lifecycle must finally close on the same risk.

References

Tags: SSHKey ManagementGovernanceLifecycle