SSH key management: enterprise best practices for 2026
Keys are identities when they are the only thing authenticating a session — treat them that way.
SSH keys power automation and operator access across every cloud estate. They also outlive employees, survive in backup repos, and get shared in chat when incidents run hot. SSH key management is the discipline of knowing which keys exist, who owns them, what they can reach, and how to revoke them in minutes — not quarters.
Keys are identities when they are the only thing authenticating a session — treat them that way. Unmanaged SSH keys are standing privilege without expiry. Centralize issuance, rotation, and attribution through your gateway and certificate authority.
Why SSH key sprawl is a security problem
Unlike passwords, SSH key pairs rarely expire by default. A key generated for a contractor in 2019 may still authenticate in 2026. authorized_keys files accumulate on hundreds of hosts. Shared team keys provide no individual attribution. Private keys without passphrases on laptops are trivial to exfiltrate.
Attackers actively hunt for keys in Git repositories, container images, and backup archives. A single leaked private key with production scope bypasses MFA entirely if it authenticates directly to targets.
Failure patterns
- Authorized_keys sprawl on hundreds of hosts.
- Shared team keys with no individual attribution.
- Keys without passphrases on operator laptops.
- Automation keys never rotated after engineer departures.
- Direct-to-target keys that bypass the gateway entirely.
Enterprise best practices for 2026
- Issue short-lived certificates from an SSH CA instead of long-lived keys.
- Prohibit direct key login to production — gateway connector only.
- Map every key to a named identity in your IdP.
- Rotate automation keys on the same schedule as passwords.
- Scan repos and images for private key material in CI.
- Log every brokered session with key fingerprint and policy version.
Gateway-first key strategy
Operators authenticate to Ixiea; the gateway validates identity and injects or proxies credentials to targets. Private keys on laptops become unnecessary for production. Automation uses dedicated service identities with narrower scope and enhanced recording.
Navigation: Admin console → Access Control → Access Policy — set Connection Method to gateway proxy only; deny direct SSH from non-connector source IPs at the network layer.
SSH certificate authorities
An SSH CA signs short-lived certificates instead of distributing long-lived public keys to every host. Certificates include principals (usernames), validity windows, and optional extensions. Revocation happens at the CA — not by editing thousands of authorized_keys files.
# Issue a 1-hour operator certificate from your CA
ssh-keygen -s ca_key -I operator-alice -n alice -V +1h alice_key.pubPair CA-backed access with gateway brokering: operators never touch CA signing keys; the gateway or a dedicated issuance service mints certificates after policy approval.
Discovery and inventory
Before rotation, discover what exists. Scan authorized_keys across registered assets, cloud metadata, and configuration management databases. Navigation: Admin console → Assets → Account Discovery identifies privileged local accounts and associated keys on onboarded servers.
- Tag each key with owner, purpose, and maximum validity.
- Remove keys with no owner or last-used date older than policy threshold.
- Block new direct key provisioning via IaC guardrails and pre-commit hooks.
Rotation and revocation
Human operator keys: rotate on role change or quarterly, whichever comes first. Automation keys: rotate on every deploy pipeline credential change and immediately on engineer offboarding. CA compromise: rotate CA key, invalidate all outstanding certificates, re-issue through gateway workflows.
Navigation: Admin console → Assets → select asset → Accounts → enable automated rotation integration with your secrets manager.
Passphrase and storage hygiene
- Require passphrases on all private keys stored on workstations.
- Prefer hardware-backed keys (YubiKey, TPM) for high-privilege operators.
- Never store private keys in ticket systems, wikis, or chat.
- Use agent forwarding sparingly — prefer gateway proxy over -A chains.
CI/CD and automation keys
Pipeline deploy keys need narrower scope than human admin keys. One key per pipeline per environment. Record automation sessions separately with enhanced command filtering. When a pipeline is decommissioned, revoke its key in the same change ticket.
Incident response
When a key is suspected compromised, revoke at the CA, disable the identity in IdP, and search session ledger for fingerprints and source IPs. If keys still exist on targets, your gateway bypass problem is not theoretical — fix parallel paths before the next review.
- Step 1 — revoke certificate or remove public key from CA and vault.
- Step 2 — disable IdP account and active gateway sessions.
- Step 3 — search Admin console → Audit → Session Ledger by fingerprint.
- Step 4 — scan targets for unauthorized keys not yet in inventory.
- Step 5 — document parallel path remediation in incident report.
Compliance alignment
PCI-DSS, SOC 2, and ISO 27001 require logical access controls and traceability for privileged access. Gateway-brokered SSH with CA-backed certificates, session recording, and quarterly access reviews satisfies assessor scenarios better than shared keys on a bastion.
Operational checklist
- Production targets accept SSH only from connector subnets.
- No shared team keys — individual identity or service identity per automation.
- Pre-commit hooks block private key commits.
- Quarterly authorized_keys audit with named owners.
- Session exports include key fingerprint and policy version pin.
sshd hardening on targets
Production sshd_config should disable PasswordAuthentication, restrict PermitRootLogin to no or prohibit-password, specify AuthorizedKeysFile paths under configuration management, and allow only gateway connector subnet in AllowUsers or Match Address blocks.
PasswordAuthentication no
PermitRootLogin no
PubkeyAuthentication yes
AllowUsers admin@10.0.0.0/24 # connector subnet onlyKey types and algorithms
Prefer Ed25519 for new keys — shorter, faster, strong. RSA 4096 remains acceptable for legacy systems. Deprecate RSA 1024 and DSA entirely. Navigation: Admin console → Settings → Security → configure minimum key algorithm policy for native client connections.
Scanning for exposed keys
- Git pre-commit hooks with detect-secrets or gitleaks.
- CI pipeline scans of container images and artifact bundles.
- Periodic trufflehog runs against internal GitLab or GitHub orgs.
- Cloud storage bucket audits for .pem and id_rsa filenames.
Finding a key in a public repository requires immediate rotation — assume compromise. Revoke CA certificates, remove public keys from all targets, and review session ledger for unauthorized use during exposure window.
Authorized_keys management at scale
Manual authorized_keys editing does not scale past a few dozen hosts. Configuration management (Ansible, Puppet, Chef) can enforce allowed keys — but only keys issued through your CA or gateway should appear. Golden rule: if a key is not in inventory, it should not authenticate.
SSH agent forwarding risks
Agent forwarding (-A) exposes your local agent to remote hosts — a compromised intermediate server can use your keys to pivot. Prefer gateway proxy over multi-hop agent forwarding. If forwarding is required, use limited lifetime keys and restrict to jump-free paths with recording.
Multi-cloud key fragmentation
Each cloud provider encourages SSH key pairs at instance launch. Without central governance, every team uploads different keys per account and region. Consolidate on gateway-brokered access: instances accept only connector subnet; operators never inject personal keys at launch.
Ixiea native client setup
Configure OpenSSH client to proxy through the gateway using the documented ProxyCommand or certificate-based connect string. Identity authenticates to Ixiea via IdP; the connector completes target handshake with vaulted credentials.
ssh -o ProxyCommand='ssh -W %h:%p gateway.example.com' \
operator@target-asset.internalKey lifecycle policy template
- Human operator keys — maximum 90-day validity if not CA-backed.
- Automation keys — rotate on pipeline change and quarterly minimum.
- Contractor keys — expire on contract end date automatically.
- Emergency keys — single-use with 4-hour validity and executive alert.
Auditor questions on SSH keys
Assessors ask: how do you inventory SSH keys, how do you revoke on termination, how do you prove who used which key, and how do you prevent direct production access. Gateway session exports with fingerprint, identity, and recording answer all four — authorized_keys spreadsheets do not.
Hardware security modules for CA keys
SSH CA signing keys belong in HSM or cloud KMS — not on an engineer laptop. Compromise of the CA key invalidates your entire trust chain. Document CA key ceremony with dual control and offline backup procedures.
Certificate revocation lists
Short-lived certificates reduce revocation urgency — a stolen cert expires in hours. For immediate revocation, maintain a CRL or OCSP responder that sshd checks, or push revoked serial numbers through configuration management faster than cert validity window.
DevSecOps pipeline integration
CI systems should receive ephemeral deployment keys minted per pipeline run from vault — not long-lived keys in GitHub Secrets. Navigation: Admin console → Assets → Service Accounts → bind automation identity with maximum session duration and command allowlist.
SSH over bastion vs. gateway proxy comparison
Bastion ProxyJump still requires target authorized_keys entries for operator or bastion keys. Gateway proxy eliminates operator keys on targets entirely — only connector service identity authenticates locally. Migration from bastion to gateway removes entire authorized_keys management category.
Regional and data residency
Session recordings and key metadata may contain data subject to residency rules. Configure Ixiea audit storage region and encryption keys per compliance zone. Key inventory exports for access reviews should respect same residency boundaries.
ssh-keygen and key ceremony
Generate operator keys on trusted workstations with ssh-keygen -t ed25519 -a 100. Private keys never leave the device except for backup to encrypted personal vault. CA signing ceremonies require two witnesses for production CA key use — document in security policy.
Forced command and restricted keys
Automation keys can use forced-command restrictions in authorized_keys — limiting what a key can execute. Gateway broker replaces most forced-command patterns with policy-based command filters that apply uniformly regardless of key type.
Migration from keys to certificates
Phase 1: inventory existing keys. Phase 2: deploy CA and issue parallel certificates with shorter validity. Phase 3: remove corresponding public keys from targets. Phase 4: disable non-CA key authentication in sshd. Gateway can broker both during transition — measure direct-key sessions trending to zero.
Third-party key audits
Contractors arriving with their own keys should not have them installed on production targets. Provide gateway access only — contractor authenticates via federated guest IdP; gateway injects scoped credentials. Remove contractor keys during offboarding checklist alongside IAM disable.
SSH key metrics dashboard
- Total inventoried keys vs. keys on production targets.
- Direct-to-target sessions per week — target zero.
- Average certificate validity remaining at connect time.
- Keys found in repo scans per month — target zero after hooks.
- Revocation events and mean time to complete revocation.
OpenSSH certificate extensions
Certificates can embed force-command, source-address, and permit-pty extensions limiting scope. Document extension schema in security standards. Gateway policy supersedes per-key extensions when all access flows through broker — simplifying to one policy layer.
Legacy system constraints
Older systems may lack Ed25519 or certificate support. Maintain exception register with compensating controls — enhanced recording, shorter JIT windows, network isolation — until hardware is replaced. Exceptions expire on defined dates requiring re-approval.
SSH key management policy document outline
- Purpose and scope — all human and automation SSH access.
- Prohibited practices — shared keys, private keys in email, direct production login.
- Issuance — CA-only for production; gateway mandatory path.
- Rotation schedules by identity class.
- Revocation procedures and incident triggers.
- Audit evidence requirements and retention periods.
Ixiea quarterly key hygiene review
Navigation: Admin console → Audit → Reports → schedule SSH Session Fingerprint report. Compare against authorized_keys scans. Investigate any fingerprint not mapped to known identity. Close gaps before quarterly access review submission.
Balancing security and developer velocity
Developers need fast production read access during incidents. Gateway with read-only default and one-click JIT write preserves velocity while maintaining evidence. Blocking all access drives shadow keys — policy should be fast for authorized paths, impossible for unauthorized ones.
SSH key management in container platforms
Kubernetes nodes and sidecars sometimes mount SSH keys as secrets. Scan cluster secrets for key material; prefer workload identity and gateway-brokered access over node SSH except during break-glass. Ephemeral debug pods should use JIT-scoped credentials, not shared node keys.
Federal and regulated sector notes
FIPS-validated cryptographic modules may require RSA over Ed25519 on certain systems. Document algorithm exceptions with compensating shorter validity windows and enhanced session recording. Gateway should enforce minimum algorithms per asset tag compliance class.
SSH key escrow and recovery
Escrow private keys only for break-glass service accounts in HSM-sealed envelopes — never for routine operators. Recovery requires dual control and post-use rotation. Routine access never depends on escrow — it depends on gateway and CA re-issuance.
Penetration test findings
Pentesters routinely find SSH keys in Git history, Jenkins credentials, and backup tapes. Remediation is revoke, rotate, and enforce gateway-only path — not delete the commit from history alone. Post-remediation rescan confirms keys no longer authenticate.
Related posts
Security Research
Zero trust security for IT and DevOps teams: the 2026 guide
Never trust, always verify — applied to privileged paths, not just VPN login. Continuous authentication, micro-segmentation, and gateway-enforced sessions.
Security Research
High-risk Linux server commands: a comprehensive security guide
Destructive commands are legitimate in maintenance — catastrophic in the wrong hands. Classify risk, assign actions, and enforce at the gateway.
Security Research
Secrets management best practices for enterprise security (2026 guide)
Centralize, rotate, and audit every credential that gates production — API keys, SSH keys, database passwords, and tokens — with vaults plus session-level brokering.