Zero Trust Netwrok Access in SSH

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up zero trust netwrok access in ssh by replacing static keys with signed certificates. Then you check user identity and limit every command before it runs on the host. Most teams start this setup by placing a bastion in front of their private servers. They copy public keys to each machine and share broad system roles across the team. When roles stay too broad, one stolen key lets an attacker move across every server. A shared Linux user also hides who ran a bad command during an outage.

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 zero trust netwrok access in ssh by replacing static keys with signed certificates. Then you check user identity and limit every command before it runs on the host. Most teams start this setup by placing a bastion in front of their private servers. They copy public keys to each machine and share broad system roles across the team. When roles stay too broad, one stolen key lets an attacker move across every server. A shared Linux user also hides who ran a bad command during an outage.

How zero trust netwrok access in ssh works with OpenSSH

OpenSSH gives you a built-in way to move away from static public keys. Since OpenSSH 5.4, the tool supports signed certificates for both users and hosts. This format is much simpler than the X.509 format used for web traffic. A Certification Authority key signs a user public key to make a valid certificate. That certificate holds the public key, an identity string, and a list of principal names. It also holds a set of options and a clear time window for use.

To set this up, your team creates a central Certification Authority key pair. You tell each target server to trust signatures from that central key. When an engineer needs to log in, the authority signs their public key. The signature sets the key identity and lists the allowed user or host principals. You must also set a short time window when you sign the certificate. If you skip the time window, the certificate stays valid forever by default. With a short window, the credential expires on its own after a few hours.

What native SSH certificates solve and what they miss

Native OpenSSH certificates solve the hard problem of distributing keys across hundreds of hosts. You no longer need to push public keys to every server when someone joins. You also avoid leaving dead keys behind when an engineer leaves the team. The target host checks the authority signature and the principal name at login time. If the principal matches and the time window is valid, the user gets in. Host certificates also stop people from spoofing servers when engineers log in.

Yet this native setup only checks who can open a shell on the box. Once the login check passes, the Linux account dictates everything the user can do. Many teams map several engineers to a single shared admin principal on the host. When three people share one OS user, standard system logs mix their actions together. You know who logged in, but you cannot tie a specific command to one person. Also, a valid certificate gives full shell control for the whole time window. It does not inspect individual commands in flight or pause dangerous deletions for approval. It also cannot mask sensitive data like emails or card numbers in command output.

Zero Trust Network Access (ZTNA) + Just-in-Time Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

Closing the gap at the command layer

Real zero trust requires rules that work after the initial login check finishes. Teams need to link every single command back to a verified human identity. You also need to restrict what commands can run inside an active session. Instead of granting a wide-open shell, you can scope tasks to safe actions. For example, a developer might check app logs without getting full root shell rights. If a command touches production data, the system can rewrite phone numbers or national IDs in results. This keeps day-to-day maintenance safe while stopping broad lateral movement across your fleet.

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 inline on the host. On every one-shot command or file transfer an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.

When a caller runs a one-shot command or moves a file, hoop.dev guardrails check the command or path before it runs, and 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 uses its own certificate format that is much simpler than X.509. It packs 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 never expires. Teams must set a short window so access ends on schedule.

Do SSH certificates control what commands a user runs after login?

Certificates can include basic options, but they mainly verify identity when the session starts. Once inside an open shell, standard OS permissions control what commands the user can run.

The query runs. The emails stay hidden.