Join our Newsletter — 33% off our NHI Course

Secure Shell (SSH) Key

An SSH key is a cryptographic key pair used to authenticate a user, service account or administrator to a remote system without a password. The private key stays secret on the client side, while the public key is placed on the target system or service, where it grants access under the associated account and permissions.

What SSH keys actually do

ssh key replace repeated password entry with cryptographic authentication. The private key remains on the client side, while the public key is trusted by the remote system or service and mapped to a specific account and its permissions.

That makes the key pair part of the access control boundary, not just a convenience feature. If the private key is copied, reused broadly, or left on too many systems, the same trust relationship that enables passwordless access can become a durable foothold.

Because the public key authorises access under an existing account, the security impact depends on the permissions attached to that account. A low-privilege account limits blast radius, while an admin or service account key can expose far more of the environment.

Where SSH keys fit in remote access

SSH keys are common for administrators, automation, and service accounts because they work reliably across servers, bastions, and build systems. They also avoid password spraying and many interactive password weaknesses, which is why they remain popular in hardened environments.

At the same time, SSH key use tends to expand over time. Keys are copied into authorized_keys, embedded in scripts, added to orchestration tooling, and sometimes shared across teams or environments. That sprawl makes ownership and inventory harder unless someone actively governs where each key is trusted.

Modern deployments increasingly pair SSH keys with certificates, bastions, OS login integrations, or other controls that reduce static key distribution. The goal is to preserve the authentication benefit while shrinking how long a key remains valid and how widely it can be used.

For a deeper treatment of how organisations govern SSH keys, certificates, bastions, and orphaned access paths, see SSH Key and SSH Certificate Management Guide.

Why SSH key management matters

An SSH key is only as safe as the lifecycle around it. Private keys can be stolen from developer laptops, build pipelines, repositories, container images, jump hosts, or backup systems, then reused silently until the key is rotated or removed.

Unlike passwords, SSH keys are often long-lived and non-interactive, which makes them attractive for persistence. If an attacker gains the private key, they may not need to defeat MFA, trigger a login prompt, or touch the original workstation again.

Short-lived certificates, restrictive principals, host key hygiene, and rapid removal of orphaned keys reduce that persistence window. For organisations that need certificate-based SSH trust, SSH Protocol and Certificate Authority Guide explains the trust and revocation model in practical terms.

Operational controls for safer SSH access

Good SSH key practice starts with inventory: know which keys exist, who owns them, where they are installed, and which systems still trust them. Without that baseline, rotation and offboarding become guesswork, especially in environments with automation accounts and shared admin access.

Control the private key like any other secret material. Keep it off shared filesystems, avoid embedding it in repositories or images, and prefer managed secrets handling where automation needs non-interactive access. Also make sure account permissions are scoped so a single key cannot unlock an entire environment.

For remote administration, pair SSH keys with stronger platform controls where possible. On managed Linux estates, Unix and Linux Privileged Access Guide covers root governance, scoped sudo, SSH certificates, and session recording, while Compute Engine Security Guide shows how OS Login and service-account design can replace metadata-based ssh key sprawl.

Risk and Threat Considerations

SSH keys are a high-value target because they can provide direct, durable access without user interaction. When the same key is reused across hosts or environments, one compromise can become lateral movement, persistence, or privileged access at scale.

Failure mechanism: The private key is stolen, copied into a repository, harvested from a pipeline or image, or left valid after the account owner changes roles, allowing an attacker or former user to keep authenticating until the key is revoked.

Impact: Attackers can access servers, automation systems, and admin surfaces under the identity already mapped to that key, which may lead to data theft, service disruption, privilege abuse, or long-term undetected persistence.

Standards & Framework Alignment

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

NIST SP 800-53 Rev 5, CIS Controls v8 and NIST SP 800-63 set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
NIST SP 800-53 Rev 5 IA-5 — Authenticator Management SSH keys are authenticators whose issuance, storage, and rotation must be controlled.
IA-9 — Service Identification and Authentication SSH keys commonly authenticate services, automation, and other non-human accounts.
AC-6 — Least Privilege SSH keys grant access under an account, so the associated permissions determine blast radius.
Recommendation — Manage SSH key issuance, storage, rotation, and revocation as authenticators. Use distinct service credentials and restrict SSH key use to approved service identities. Limit the account privileges behind each SSH key to the minimum required.
CIS Controls v8 CIS-5 — Account Management SSH keys are account access paths that require inventory, ownership, and removal control.
Recommendation — Inventory SSH-backed accounts and remove dormant or unowned access paths.
NIST SP 800-63 AAL2 — Phishing-Resistant Authentication SSH keys are a phishing-resistant authenticator pattern when properly managed.
Recommendation — Prefer phishing-resistant authentication for remote access and constrain SSH key trust.

Practitioner Guidance

Why practitioners should care: Treat SSH keys as governed access credentials, not as harmless setup files. The practical question is not whether a key works, but whether you can prove who owns it, where it is used, and how quickly you can revoke it.

What to watch for: Stale keys, shared keys, keys with write or admin reach, and keys present in automation or developer tooling without clear ownership. A key that outlives its user or purpose is usually a control failure, not just an operational nuisance.

For audit and offboarding patterns, How to find unused GitHub deploy keys and SSH keys is a useful example of how to identify idle access and remove it safely.