Revoke the identity immediately, confirm whether it was copied into scripts or automation, and verify that no dependent workload still requires it. Then update the inventory and ownership record so the same access path cannot reappear unnoticed. The goal is to close the trust path, not just delete a file.
Why This Matters for Security Teams
Stale SSH access is rarely just an orphaned login. It is usually a trust path that has outlived its owner, its purpose, or both. Because SSH is often used for admin access, automation, and break-glass work, a stale key can bypass normal application controls and land directly in a privileged shell. That is why NHI governance treats SSH credentials as non-human identities, not as simple files to delete.
Current guidance from the OWASP Non-Human Identity Top 10 aligns with what NHI Management Group has documented in the Ultimate Guide to NHIs: visibility, ownership, and lifecycle control matter more than the credential format itself. NHIMG research also shows that only 20% of organisations have formal processes for offboarding and revoking API keys, and even fewer have procedures for rotation. The same operational gap shows up with SSH, where access is often copied into scripts, embedded in CI/CD jobs, or left on servers long after the original task ended.
In practice, many security teams discover stale SSH access only after a maintenance window, incident review, or audit has already exposed how long the path remained live.
How It Works in Practice
The right response is to treat stale SSH access as an identity lifecycle event, not just a host hygiene issue. First, revoke the key or account at the source of authority, then verify every place it may have been replicated. That includes jump hosts, automation runners, configuration management, golden images, and personal workstations. If the credential was used by an application or script, determine whether it is a true human artifact or a workload identity that still needs a controlled replacement.
This is where NHI discipline becomes practical. The Ultimate Guide to NHIs emphasizes that secrets often persist in code and operational tooling long after teams believe they are retired. To prevent recurrence, update the inventory with ownership, purpose, TTL, last-used timestamp, and system dependency. Then attach a lifecycle action: rotate, replace, or retire.
- Revoke the SSH identity immediately at the authoritative system.
- Search for copied keys in scripts, vaults, CI/CD variables, and backup images.
- Confirm whether any workload still depends on the access path.
- Replace manual SSH where possible with short-lived, policy-controlled access.
- Record the cleanup in inventory so the same key cannot reappear unnoticed.
Where teams are modernising access, they often shift from long-lived ssh key to just-in-time access with short TTLs, workload identity, or brokered session controls. That approach aligns with broader identity guidance in the OWASP Non-Human Identity Top 10 and reduces the chance that a forgotten key can be reused later. These controls tend to break down in legacy environments with unmanaged servers, embedded device fleets, or shared admin jump boxes because ownership and revocation paths are not consistently enforced.
Common Variations and Edge Cases
Tighter SSH revocation often increases operational friction, requiring organisations to balance rapid containment against the risk of interrupting live automation. That tradeoff is real, especially when the stale credential belongs to a service script or legacy maintenance process rather than a person.
There is no universal standard for every edge case, but current guidance suggests using a clear decision tree. If the access is human-owned and inactive, revoke immediately. If it is machine-owned, validate the workload, issue a replacement credential, and retire the old one only after the new path is confirmed. If the key appears in multiple places, assume the broader footprint is the real problem and hunt for reuse across environments.
Two cases deserve extra caution. First, shared admin keys often hide poor accountability, so one stale login may represent several undocumented users. Second, ephemeral cloud instances and auto-scaling nodes can recreate stale trust if base images or bootstrap scripts still contain the credential. NHI Management Group’s 52 NHI Breaches Analysis is useful here because many incidents repeat the same pattern: access is removed locally but never removed from the upstream process that recreates it. The practical fix is to close the issuing path, not just the endpoint.
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 address the attack and risk surface, while NIST CSF 2.0 and NIST AI RMF set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | Stale SSH access is an unmanaged non-human identity and secret lifecycle failure. |
| NIST CSF 2.0 | PR.AC-1 | Immediate revocation and dependency checks support access control containment. |
| NIST AI RMF | Lifecycle governance and accountability reduce unmanaged access risk across automated systems. |
Remove stale access quickly, validate dependencies, and prevent reissuance through controlled approval paths.