SSH Bastion Server

Published
Length
3 min read

Luis Felipe Dias

All posts

An ssh bastion server is a single public Linux host that guards your private network. You set it up by hardening one host and routing all admin traffic through it. Most teams place this jump host in a public subnet to hide private machines. Engineers log in to the public host first, then jump to private servers. When teams share static keys or broad roles on this host, risk grows fast. One stolen key or wide role can expose every backend server in the fleet. How an ssh bastion server works wit

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.

An ssh bastion server is a single public Linux host that guards your private network. You set it up by hardening one host and routing all admin traffic through it. Most teams place this jump host in a public subnet to hide private machines. Engineers log in to the public host first, then jump to private servers. When teams share static keys or broad roles on this host, risk grows fast. One stolen key or wide role can expose every backend server in the fleet.

How an ssh bastion server works with OpenSSH

To build a clean setup, you put one hardened Linux server on the perimeter. Firewall rules block direct public traffic to all private servers inside your network. Those private servers only accept traffic that comes from the ssh bastion server. Engineers do not keep static private keys on the jump host itself. Instead, they forward their local agent or jump through the host in one step.

Managing static public keys across hundreds of private hosts gets messy very fast. When someone leaves the team, you must delete their key from every machine. OpenSSH solves this problem with its own simple certificate format, added in OpenSSH 5.4. This format is much simpler than the X.509 format used in web traffic.

A Certification Authority key signs a user public key to make a certificate. Each certificate holds a public key, an identity string, principal names, and options. You can also set a validity window so the certificate expires on time. If you do not set a window, the certificate stays valid forever. You can sign host certificates the same way so users trust your servers.

Why teams add certificates to a jump host

When you use OpenSSH certificates, private hosts only need to trust the CA key. You no longer copy user keys to every new server you spin up. The certificate lists the allowed principals, which match user or host names on target machines. When an engineer connects, the target server checks the CA signature and the principal list.

Certificates also let admins bake options right into the signed file. You can lock down port forwarding or force a specific command to run. This gives teams a solid way to verify who can log in. It also stops old keys from lingering on servers for years without review.

SSH Bastion Hosts / Jump Servers + Kubernetes API Server Access: architecture patterns and best practices

Continue reading? Get the full guide.

Free. No spam. Unsubscribe anytime.

What native jump host setups leave open

Network rules and OpenSSH certificates solve the problem of who can log in. They verify the user identity and check that the certificate is still valid. Still, once the shell opens, the native setup stops watching what happens next. A valid principal with shell rights can run any command that OS user allows.

The jump host only passes encrypted bytes back and forth between client and server. It does not inspect individual commands or block risky actions in flight. If an engineer runs a destructive command or reads sensitive files, the host allows it. Also, when terminal output prints sensitive data like emails, phone numbers, or card numbers, raw text flows straight to the user screen. Native SSH tools cannot rewrite matched fields in results before they reach the client.

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 provides an open-source SSH server with guardrails on the host that uses OpenSSH certificates.

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

What is the difference between a jump host and an ssh bastion server?

Both terms describe the same core setup in daily engineering work. Teams use a single hardened host as the entry point to private servers. Some admins call it a jump host when users pass through it without stopping.

Why should you avoid storing private keys on the bastion host?

If an attacker breaks into the bastion host, they can steal any stored keys. They can then use those keys to log in to every private backend server. Keeping keys off the host prevents a single breach from spreading across your fleet.

Do OpenSSH certificates expire on their own by default?

No, OpenSSH certificates stay valid forever unless you set a validity window during signing. Admins must always set a start and end time when signing a user key. Short validity windows limit the damage if a user device is lost or stolen.

The query runs. The emails stay hidden.