SSH Keys Management Best Practices
Following ssh keys management best practices means replacing static key files with signed OpenSSH certificates. Teams must also set short life spans and limit user permissions on every host. Most engineering teams start by copying public keys to individual servers or a jump host. Over time, those static keys pile up and grant broad shell permissions that nobody tracks. When an engineer leaves or switches roles, old keys often stay active on production machines. Core ssh keys management best pr
Your coding agents run with your access.
Claude Code reaches prod with a developer's credentials, and approval prompts get clicked through. hoop.dev checks every query, masks sensitive data, and holds risky changes for a human.
Following ssh keys management best practices means replacing static key files with signed OpenSSH certificates. Teams must also set short life spans and limit user permissions on every host. Most engineering teams start by copying public keys to individual servers or a jump host. Over time, those static keys pile up and grant broad shell permissions that nobody tracks. When an engineer leaves or switches roles, old keys often stay active on production machines.
Core ssh keys management best practices with OpenSSH certificates
Static public keys create an operational mess as server fleets grow. Admins must push updated key lists to every machine and clean up stale entries by hand. OpenSSH offers a native certificate authority model that fixes this key distribution problem. An OpenSSH certificate is much simpler in format than standard TLS certificates. It holds a public key, an identity string, principal names, and options signed by a central key.
To use this model, the security team generates a central authority key pair. Each server trusts this single authority public key instead of hundreds of individual user keys. When an engineer needs to log in, the authority signs their public key to make a user certificate. The signing process attaches a key identity for logs and lists valid user principals. Admins can also sign host keys so client machines trust servers without manual fingerprint checks.
Setting a strict validity window on every user certificate is vital. By default, signed certificates stay valid forever, which brings back the old static key risk. Teams should set a short time window during signing so certificates expire after a few hours. Once the window closes, the server rejects the certificate without needing a revocation list.
What native key controls solve and what they leave open
Moving to short-lived OpenSSH certificates solves key sprawl and manual file cleanup across hosts. Servers no longer store long lists of static keys in local user folders. The signing step also lets admins attach certificate options that limit how a session works. Even with these solid login checks, native SSH setup still leaves a major operational gap.
OpenSSH certificates decide who can log in to a server and which Linux account they use. Still, once the shell opens, the certificate does not inspect or govern individual commands in flight. Two engineers often share the same Linux principal, such as a generic admin or deploy user. On the host, their actions blend together, and standard system logs struggle to tie commands to one person.
SSH Access Management + AWS IAM Best Practices: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Also, native SSH setup cannot pause a risky command for peer approval while a session is live. If a user has shell permissions to read a file or query a local database, raw data prints right to their screen. Native SSH keys cannot rewrite sensitive fields like emails, phone numbers, or card numbers in command output. Teams still need a way to govern live commands and protect sensitive data after login succeeds.
Add command and file guardrails to SSH access
Host firewalls and certificate principals control who opens an SSH session. Yet an allowed user or agent can still run a bad one-shot command or pull sensitive files over sftp. In practice, hoop.dev sits inline on the host as an open-source SSH server with guardrails that uses OpenSSH certificates. For every one-shot command or sftp task an agent or human runs in production, hoop.dev decides to pass, mask, block, or escalate it for review.
Using hoop.dev SSH controls, guardrails check one-shot commands, env variable names, and sftp or scp paths before they run. Port forwards default to deny unless the target is listed. Because interactive shells have no statement boundary and carry no guardrails, teams can turn them off so every command is checked and logged. Check out the MIT-licensed project on GitHub.
Frequently asked questions
Why are OpenSSH certificates better than static SSH keys?
Static keys stay valid until someone deletes them from every single server. OpenSSH certificates include an expiration time and need only one trusted authority key on each host.
How do principals work in an OpenSSH user certificate?
Principals are the specific user or host names listed inside the signed certificate. A server lets a user log in only if the certificate principal matches an allowed account name.
Do OpenSSH certificates control what commands a user runs after login?
Certificates can restrict a session during login, but they do not inspect live shell commands one by one. Once a general shell opens, the local operating system permissions control everything the user does.
Short role checks help teams work fast. Simple rules make each review clear. Good logs keep every team safe. Scoped keys stop bad changes early.
Related guides
In this post