Use Ed25519 as the default, generate the pair with ssh-keygen, protect the private key with a strong passphrase, and copy only the public key to the server or service that needs it. Keep the private key on the local machine, store keys in the standard .ssh directory, and avoid shared keys so access remains traceable and easier to revoke.
Why everyday administrative SSH access should be key-based, not password-based
For routine admin access, SSH keys give you a stronger and more operationally manageable trust model than shared passwords. Each administrator can have a distinct key pair, which makes access traceable, easier to revoke, and less likely to be reused across systems. The private key stays local; the server only needs the public half.
Using key-based access also reduces pressure on password policy, removes a common phishing and guessing target, and gives you a cleaner revocation path when someone changes role or leaves the team. The key decision is not just “can SSH work?” but “can you prove who had access and remove it quickly when needed?”
For teams standardising this pattern, the SSH Key and SSH Certificate Management Guide is the right starting point for governing key sprawl, authorized_keys risk, and revocation.
How to set up SSH keys so administration stays controlled
Use one key pair per person and per use case, rather than a shared team key. That lets you remove a single admin without breaking everyone else’s access, and it gives you an audit trail when you need to answer who connected from where. Keep the private key in the user’s local .ssh directory and protect it with a strong passphrase so theft of the file alone is not enough to gain access.
Generate the key pair with ssh-keygen and use Ed25519 by default unless you have a documented compatibility constraint. The practical benefit is simple: modern keys are fast, widely supported in current OpenSSH deployments, and easy to standardise across laptops, jump hosts and automation workstations. Copy only the public key to the destination account or service that needs SSH access.
If your environment depends on managed admin access across many hosts, the Unix and Linux Privileged Access Guide provides a broader operating model for root governance, scoped sudo, and SSH certificates.
For teams using certificates instead of long-lived static keys, the SSH Protocol and Certificate Authority Guide covers principals, host certificates, CA custody, and revocation lists.
What commonly goes wrong with SSH keys for admin access
The biggest failure mode is key sprawl, where keys are created once and then forgotten. Stale keys often survive role changes, project handoffs and offboarding, which means access can remain valid long after the original need has gone. Shared keys make this worse because they hide ownership and complicate revocation.
Another common problem is treating the private key like a convenience file instead of a credential. If it is left unprotected, copied into scripts, or stored on unmanaged systems, anyone who obtains it can authenticate as that admin. A related issue is spreading the same key across multiple systems, which increases blast radius if the key is ever exposed.
Exposure risk is not theoretical. Public and private keys frequently appear in source repositories, container images, CI/CD workflows, and misconfigured automation paths. The CI/CD pipeline exploitation case study shows how an attacker can plant an SSH key through a poisoned pipeline when secrets or build-time access are not controlled.
If you need a broader view of leak paths and containment, the Cloud Access Key Leak Playbook is useful for the same core response pattern: contain, rotate, hunt for persistence, and then recover safely.
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 addresses the attack and risk surface, while NIST SP 800-53 Rev 5 and CIS Controls v8 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 that require lifecycle control and rotation. |
| IA-2 — Identification and Authentication (Organizational Users) | Admin SSH access depends on individually attributable user authentication. | |
| AC-6 — Least Privilege | SSH admin access should be scoped to the minimum needed for each operator. | |
| Recommendation — Manage SSH keys as authenticators with defined issuance, storage, rotation and revocation rules. Require unique user authentication for administrative SSH access and avoid shared accounts. Limit SSH-based administrative privileges to the smallest set of hosts and commands required. | ||
| CIS Controls v8 | CIS-5 — Account Management | SSH keys are tied to account lifecycle, onboarding, and offboarding discipline. |
| Recommendation — Inventory and remove SSH access promptly when accounts change role or leave. | ||
| OWASP Non-Human Identity Top 10 | NHI-07 — Long-Lived Secrets | Static SSH keys are long-lived secrets that need rotation and exposure control. |
| Recommendation — Replace durable SSH keys with shorter-lived or more tightly governed credentials where possible. | ||
Practitioner Guidance
What to verify: Confirm that every administrative SSH key maps to one named user, one known device, and one documented purpose. If a key is shared, reused, or impossible to attribute, treat it as a governance defect rather than a minor housekeeping issue.
Decision rule: If the private key can open production access, prioritise revocation readiness, revocation testing, and blast-radius reduction before you optimise convenience. If you cannot rotate or remove a key quickly, the setup is too fragile for everyday admin use.
Common mistake: Teams often harden the key algorithm but ignore lifecycle control. Key strength matters, but stale keys, copied private keys, and orphaned authorized_keys entries are usually the real operational weakness.
Practitioner takeaway: The right SSH setup is not the one that merely authenticates successfully, it is the one you can attribute, scope, and revoke without delay when access changes.
Related resources from NHI Mgmt Group
- How should security teams replace static SSH keys with short-lived access controls?
- How should security teams implement device-bound SSH access across large server fleets without relying on shared keys?
- How should security teams harden Linux access without relying on static SSH keys?
- How should security teams set up remote desktop access so it stays simple without exposing devices to the public internet?
Deepen Your Knowledge
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.
Reviewed and updated by the NHIMG editorial team on November 5, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org