Security

SSH Key Management: The Enterprise Security Blind Spot

OraSecSeptember 3, 20254 min read

Written by the OraSec security research team — offensive security engineers and penetration testers.

ssh-key-management-blind-spot

<span style="white-space: pre-wrap;">SSH key management is where access quietly outlives its owner an authorised key left in place keeps the door open long after anyone remembers why.</span>

A password usually has an owner and a reset or revocation process. An unmanaged SSH key can sit outside that lifecycle and still open the door years later.

What Are SSH Keys?

SSH public-key authentication uses a cryptographic key pair: a private key and a corresponding public key. The private key stays with the user or service, in a file, an agent, or a hardware token. In a typical OpenSSH deployment, the public key is authorised through ~/.ssh/authorized_keys on the target host. (OpenSSH)

Anyone holding the private key corresponding to an authorised public key may authenticate as that account, subject to any additional server-side restrictions or authentication requirements.

NIST published IR 7966 in October 2015, whose abstract noted that "the security of SSH key-based access has been largely ignored to date." A decade on, that is still broadly true. (NIST IR 7966)

How Does SSH Key Authentication Work?

The client proves possession of the private key by producing a cryptographic signature tied to the SSH authentication exchange; the private key itself is never sent to the server. That removes several risks associated with reusable passwords, so public-key authentication can provide stronger authentication when the private key is properly protected. (OpenSSH)

Common key types are RSA, ECDSA, and Ed25519. Ed25519 keys are 256 bits and strong at that size, so key length is not comparable across algorithms. For RSA, 2048 bits still meets NIST's current minimum security-strength requirement, while RSA-3072 corresponds to roughly 128 bits of classical security and is a stronger choice for new keys. (NIST)

Why Do SSH Keys Become a Blind Spot?

No inherent expiry. A raw SSH public key does not carry an expiration date, so an unmanaged authorized_keys entry can remain valid indefinitely. An unrestricted entry added in 2019 can still work in 2026 unless it is removed, revoked, expired through configuration, or otherwise blocked. (OpenSSH)

No central issuance by default. In an unmanaged deployment, a user who can modify their own authorized_keys can create and authorise a new key without going through a central provisioning workflow.

No inventory. Keys live in per-user files scattered across every host. Nothing collects them by default, so nobody can say who holds access to what.

Leaver processes can miss them. If a server uses a separate local account rather than the disabled directory identity, an authorised key may remain usable until that local access is revoked.

Privileged access management can miss them. PAM platforms miss unmanaged SSH keys when key discovery and SSH access are not integrated into the deployment.

Where Does the Volume Come From?

Interactive logins are the small half. The large half is automation, and NIST notes automated SSH access is used for high-privilege operations including file transfers, disaster recovery, and patch management. Those keys are hardest to remove, because nobody is sure what breaks. (NIST IR 7966)

What Does This Look Like in Practice?

In the Virtualizor incident of August 2026, a backdoored update added an attacker-controlled key to root's authorized_keys.

That single line can outlive the surrounding malware. On the examined node, the injected key provided passwordless root access until the authorised-key entry was removed or otherwise revoked. (LowEndTalk)

Why Does It Matter?

Keys accumulate access. A key trusted on many hosts turns one compromised workstation into movement across an estate, and those logins look routine.

Additions also go unnoticed. Most organisations can list their privileged users. Far fewer can list their keys, who added each, and whether it is still needed.

Common Mistakes

  • Treating key authentication as automatically safe. It removes password risk, not access-lifecycle risk.
  • Enabling agent forwarding unnecessarily. Someone with access to a forwarded agent socket can use your loaded identities to authenticate onward. (OpenSSH)
  • Generating keys without passphrases. An unprotected private key on a laptop is a credential sitting in a file.

How to Reduce the Risk

  • Inventory authorized_keys on every host, and record an owner for each
  • Move to SSH certificates, which carry a validity period and expire on their own
  • Combine from=, command=, and restrict to limit where a key can be used and what it can do
  • Alert on any change to authorized_keys, especially root and service accounts

What Should Security Testing Cover?

Ask your testers to establish:

  • Which hosts one recovered private key can reach
  • Whether adding a key to a privileged account raises an alert anyone acts on

How OraSec Can Help

SSH key access is one of the clearest gaps between an access list and reality. OraSec's internal penetration testing follows key-based trust to establish what one compromised key reaches, and red teaming tests whether adding one gets noticed.

Conclusion

A line in a text file grants standing privileged access, and unless someone configures an expiry, records who added it, and watches for changes, nothing does.

Until you can produce that inventory, your access review covers the accounts you know about, not the access that exists.

FAQs

Do SSH keys expire? Raw SSH public keys have no inherent expiry. OpenSSH can apply an expiry-time= to an authorised-key entry, while SSH certificates include explicit validity periods.

Are SSH keys more secure than passwords? Properly protected SSH keys can provide stronger authentication than reusable passwords, but key-based authentication is not automatically secure if key lifecycle and private-key protection are weak.

How do we find unused SSH keys? Collect authorized_keys from every host, match each entry to an owner and purpose, then remove anything nobody claims.

What is SSH key sprawl? Authorised keys accumulating across an estate faster than anyone removes them, until the total set of access is unknown.

Explore related services

Need hands-on help? Our security testing services put this research into practice.

VPN security guidelines infographic showing NSA and CISA recommendations
Security

VPN Security Guidelines: How NSA and CISA's Latest Recommendations Protect Your Network

The digital world is evolving, and organizations all over the world are facing increasing threats to their network infrastructure. Over the past few years, the National Security Agency (NSA) and the Cybersecurity and Infrastructure Security Agency (CISA) released detailed VPN security guidelines to help organizations strengthen their remote access solutions. The guidelines outline key vulnerabilities and offer practical guidance to protect virtual private networks against sophisticated cyberatta

·3 min read
MCP Server AI cyber defense architecture diagram showing automated threat detection
Security

What is MCP Server—How it is Powering AI-Driven Cyber Defense

In this increasingly changing cybersecurity environment, businesses are confronted with increasingly sophisticated threats that conventional security solutions find hard to combat. Additionally, MCP Server AI cyber defense is a game-changing method for automated threat detection and response. Moreover, Model Context Protocol (MCP) servers are also revolutionizing artificial intelligence integration with cybersecurity infrastructure in a bid to create intelligent defense mechanisms that respond

·3 min read
Top zero trust security vendors comparison chart for 2025
Security

10 Best Zero Trust Security Vendors—2025

With the pace of advancements in the cybersecurity world today, legacy perimeter-based security frameworks are no longer adequate to safeguard companies from sophisticated cyber attacks. Zero trust security vendors have become the foundation of new-generation enterprise security strategies, revolutionizing how companies design their data protection and access management strategies. As businesses increasingly embrace remote work, cloud computing, and digital transformation, the need for robust z

·6 min read