Zero Trust Network Access in SSH

Published
Length
3 min read

Luis Felipe Dias

All posts

You set up zero trust network access in ssh by replacing static keys with signed certificates. You also verify every user and device before opening a host session. Most teams start by locking down network paths with a bastion or jump host. Next, they map team groups to shared Linux accounts on each server. When those local accounts hold broad permissions, any user who logs in can run risky shell commands. How to set up zero trust network access in ssh with certificates A strong setup moves aw

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 network access in ssh by replacing static keys with signed certificates. You also verify every user and device before opening a host session. Most teams start by locking down network paths with a bastion or jump host. Next, they map team groups to shared Linux accounts on each server. When those local accounts hold broad permissions, any user who logs in can run risky shell commands.

How to set up zero trust network access in ssh with certificates

A strong setup moves away from static public keys saved on every server. Instead, you use a certificate authority key to sign user and host keys. OpenSSH added this simpler certificate format to verify users and hosts without complex X.509 chains. Each signed certificate holds a public key, an identity string, and a list of principal names. It also holds a set of options and a strict time window.

When an engineer needs to log in, they prove their identity first. The signing authority then signs their public key for a short time window. If you do not set a time limit, OpenSSH certificates stay valid forever by default. Always set a short window so stolen files expire fast. The target server trusts the authority key and checks the principal name before opening a shell.

Host certificates work in the other direction to stop machine spoofing. The authority signs each server key with its host name. The client checks this signature so users never log in to a fake server. You can also place a jump host in front of private networks. This forces all SSH traffic through one network chokepoint.

Where native SSH certificates and network checks fall short

Native certificates and network checks solve the login problem well. They verify who can reach a port and which Linux user they become. You do not have to copy static keys to hundreds of servers anymore. When a person leaves the team, their short certificate expires on its own.

Still, login checks only decide who gets into the box. Once the shell opens, the server trusts the local Linux user for the whole session. If five engineers share one admin principal, they all get the same broad shell rights. A network rule cannot tell a safe status check apart from a destructive file delete.

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.

OpenSSH does let you bind a certificate to one forced command. That works well for automated backup scripts or fixed tasks. It breaks down when engineers need to debug live issues with varied commands. Standard system logs also struggle to capture full terminal output or mask sensitive data. If a command prints customer emails or card numbers, that raw text appears right on the screen.

Closing the gap at the command and data layer

True least privilege in SSH requires control after the login step finishes. Teams need to inspect and approve individual commands before the server runs them. They also need a way to rewrite sensitive fields like phone numbers or national IDs in flight. Separating login trust from runtime command checks keeps live hosts safe during everyday work.

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 are OpenSSH certificates different from static SSH keys?

Static keys sit on servers forever until someone deletes them by hand. An OpenSSH certificate wraps a public key with an identity, allowed principals, and an expiration time. A central authority signs the file so servers trust it without storing user keys.

Do SSH certificates stop users from running dangerous shell commands?

No, standard user certificates only control who can log in to a specific Linux account. Once the shell starts, the user can run any command that the local account allows. You can lock a certificate to one fixed command, but that blocks normal interactive work.

Why is a jump host not enough for zero trust SSH?

A jump host only controls network routing between the user and the private server. It checks that a user can cross the network perimeter. It does not restrict what commands run inside the shell or rewrite sensitive data in output.

The query runs. The emails stay hidden.