SSH Key Management As a Service

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up ssh key management as a service by using a central authority to sign user keys. This central system replaces static public key files on every Linux server. Most teams start by copying raw public keys to remote hosts by hand. Over time, old keys stay on servers long after people leave the team. Broad Linux roles then let anyone with a valid key run any command. How ssh key management as a service works with OpenSSH OpenSSH added support for user and host certificates in version 5.4.

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.

You set up ssh key management as a service by using a central authority to sign user keys. This central system replaces static public key files on every Linux server. Most teams start by copying raw public keys to remote hosts by hand. Over time, old keys stay on servers long after people leave the team. Broad Linux roles then let anyone with a valid key run any command.

How ssh key management as a service works with OpenSSH

OpenSSH added support for user and host certificates in version 5.4. The key generation tool signs a public key with a Certification Authority key. This step creates a simple certificate for user or host login checks. The format is much simpler than the X.509 format used in web traffic. Each certificate holds a public key, an identity string, and principal names. It also holds a set of options signed by the authority key.

During the signing step, an admin sets a key identity string for logs. The admin also adds one or more user or host names as principals. By default, the tool makes a user certificate during this signing process. The admin can also ask the tool to make a host certificate instead. The signing step also takes a time window to limit how long keys work. Without a time window, a signed certificate stays valid forever by default. Target hosts only need to trust the single central authority public key. They no longer need a long list of user keys on disk.

Why host principals and static keys leave gaps

Central key signing fixes the pain of copying static files to every server. It also stops old keys from working if you set a short time window. Yet a valid certificate only checks who can log in to a host. Once the shell opens, the Linux user account sets all the rules. If three engineers share one principal name, they share the same host role. The server cannot tell which person ran a bad command inside that shared role.

Standard SSH checks also do not inspect what happens inside the open shell. An engineer with root rights can read secret files or drop production tables. Native key tools cannot pause a risky command to ask for a peer check. They also cannot rewrite sensitive fields like emails or phone numbers in output. Teams that use a jump host or bastion still face this exact same gap. The server checks the key at the door, then trusts every single command.

SSH Key Rotation + Authorization as a Service: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Planning a clean key lifecycle for Linux hosts

Start by finding every static public key sitting on your servers today. Group your servers by the job they do and who needs to log in. Set up a central authority key and keep the private part locked away. Give each user certificate a clear identity name that matches a real person. Always set a short time limit when you sign a user public key. Remove old static key files once the central trust setup works well. Check your server logs often to see which key identities log in each day. Keep principal lists small so one certificate cannot log in to every server.

Check SSH commands and file transfers on the host

OpenSSH keys and certificates decide who can log into a Linux host. They do not check what a one-shot command or file transfer does once the session starts. With hoop.dev, you run an open-source SSH server with guardrails on the host. It checks callers with OpenSSH certificates and works with ssh, sftp, scp, and rsync clients.

When a caller runs a one-shot command or moves a file, hoop.dev guardrails check the command or path before it runs. Then hoop.dev data masking masks matched sensitive patterns in downloads and output. Interactive shells carry no guardrails because keystrokes have no statement boundary. Teams can turn interactive shells off and allow only commands and file tasks. The audit trail logs who connected and what was allowed or refused, without storing keystrokes or file bytes. See the source on GitHub.

Frequently asked questions

How do OpenSSH certificates differ from X.509 certificates?

OpenSSH certificates use a much simpler format than X.509 certificates. They hold a public key, an identity, principals, and options signed by an authority key.

What happens if you do not set a validity time on an OpenSSH certificate?

If you do not set a time window during signing, the certificate stays valid forever. Teams must set a short validity window so signed keys expire on time.

Does ssh key management as a service control commands inside a session?

No, key signing only checks who can log in to the target host. Once logged in, the local Linux user role controls what commands can run.

The query runs. The emails stay hidden.