Join our Newsletter — 33% off our NHI Course
Home› Glossary› NHI Lifecycle Management› SSH Key Persistence
NHI Lifecycle Management

SSH Key Persistence

← Back to Glossary
By NHI Mgmt Group Updated November 16, 2026 Domain: NHI Lifecycle Management

SSH key persistence is the retention of an SSH public key on a system or account so it continues to grant access across sessions or after other credentials change. It usually appears in authorised_keys files, admin accounts, or automation users, and becomes a control issue when keys are not rotated, removed, or tied to ownership.

What SSH key persistence means in practice

SSH key persistence is not just the existence of a key, it is the continued ability of that key to authenticate long after the original operator, project, or credential state has changed. That makes it a lifecycle problem as much as an access problem, because the key can outlive the review that should have removed it.

In real environments, persistence usually comes from authorized_keys, shared admin accounts, automation users, or project-wide key distribution. Once a key is embedded in those paths, it can keep working even when passwords are reset, MFA is added, or another account credential is rotated.

Where persistence shows up

The issue tends to appear in places where SSH access was added for speed and then never re-evaluated. That includes old deployment keys, break-glass admin access, jump hosts, and unattended automation jobs that still depend on a key first issued for a temporary purpose.

It also appears when ownership is unclear. If no one knows which team, person, or system is responsible for a key, removal becomes risky and keys remain in place by default. The longer that ownership gap lasts, the more the key behaves like standing access rather than a controlled exception.

For practical guidance on discovery, rotation, and removal at scale, see the SSH Key and SSH Certificate Management Guide.

Why persistent SSH keys are dangerous

A persistent SSH key creates durable access that may bypass ordinary credential hygiene. If an attacker steals the private key, or if a former operator retains access to a shared key, the account can remain reachable even after passwords, tokens, or user records have been updated.

Persistence becomes more serious when keys are tied to privileged accounts or automation users. In those cases, one stale key can preserve administrative reach, enable lateral movement, and keep a foothold alive inside servers, CI/CD systems, or cloud instances.

That same pattern has shown up in intrusion reporting and supply-chain abuse, where keys are not merely an access method but a way to retain access after the initial compromise is discovered. Salt Typhoon telecom intrusions 2025 is one example of how stolen credentials and related access material can be used to persist. Another is GhostAction returns 2026, where stolen credentials and secret theft supported broad follow-on abuse.

How organisations check and reduce exposure

The first control question is simple: where do SSH keys still grant access, and who owns them now? That means inventorying authorised keys across servers, reviewing deploy keys and automation accounts, checking cloud and bastion paths, and comparing live access against current ownership records.

Rotation alone is not enough if the old key remains authorised somewhere else. Organisations need to remove orphaned keys, revoke unused keys, and prefer short-lived or centrally managed access patterns where possible. SSH certificates can help because they shift the problem from endless key sprawl to governed issuance and revocation.

The strongest practical model is to treat SSH access as a governed lifecycle, not a one-time setup task. The SSH Protocol and Certificate Authority Guide explains the certificate model, while How to Find ssh authorized keys across a server fleet shows how to inventory and triage keys across many systems.

Detection and post-compromise review

When SSH key persistence is suspected, the question is not only whether a key exists, but whether it was used after it should have been removed. That makes login logs, key fingerprints, authorised key histories, and recent privilege changes important evidence sources.

After a compromise, organisations should assume the private key may be copied and the trust path may be wider than expected. Review all reachable systems, check for new keys planted in authorized_keys, and validate that any jump host, CI runner, or admin account did not become a persistence point.

The response pattern is well captured in SSH Key Compromise Response Playbook, and it becomes especially important when the access path runs through shared administration infrastructure such as a bastion. In those cases, If your jump host and bastion is compromised gives the right containment lens. For broader identity-centric detection and response patterns, the Identity Threat Detection and Response (ITDR) Guide is a useful companion.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST SP 800-53 Rev 5, CIS Controls v8 and NIST SP 800-57 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementSSH key persistence is a credential lifecycle problem governed by authenticator issuance, rotation, and revocation.
AC-2 — Account ManagementPersistent SSH keys often survive account changes because access is not fully removed from accounts and groups.
IA-2 — Identification and Authentication (Organizational Users)SSH key authentication is a user access mechanism that must be controlled and tied to account identity.
Recommendation — Enforce IA-5 to track SSH key issuance, rotation, revocation, and replacement when access changes. Apply AC-2 to remove stale SSH access when accounts, roles, or ownership change. Use IA-2 to ensure SSH access is bound to managed identities rather than unmanaged key reuse.
CIS Controls v8CIS-5 — Account ManagementSSH key persistence is a stale-account and stale-access problem requiring continuous account and access review.
CIS-6 — Access Control ManagementPersistent keys preserve access beyond intended lifecycle, so access enforcement must include key removal and restriction.
Recommendation — Use CIS-5 to inventory, review, and remove unused SSH access paths and orphaned accounts. Apply CIS-6 to restrict SSH access, remove unnecessary keys, and validate least-privilege access.
NIST SP 800-571 — Key ManagementSSH key persistence is fundamentally about key lifecycle, rotation, and retirement over time.
Recommendation — Apply key lifecycle discipline to rotate, retire, and revoke SSH keys when access is no longer needed.
OWASP Non-Human Identity Top 10NHI-01 — Improper OffboardingKeys persist when removal and offboarding do not fully clean up access paths and ownership.
NHI-05 — Overprivileged NHIPersistent SSH keys often keep more privilege than the task requires, especially for admins and automation.
NHI-07 — Long-Lived SecretsSSH keys are long-lived authenticators when they remain valid across sessions and changes.
Recommendation — Remove SSH keys during offboarding so access cannot survive the owner’s departure. Reduce SSH key privilege to the minimum needed and remove standing privileged access. Replace long-lived SSH keys with shorter-lived credentials or certificate-based access.
MITRE ATT&CKT1098.004 — Account Manipulation: SSH Authorized KeysAttackers add or keep SSH authorized keys to preserve remote access after compromise.
Recommendation — Monitor for T1098.004 activity and alert on unexpected changes to authorized_keys.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 16, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org