How to Configure Amazon Linux Relay Host
You set up an amazon linux relay host by placing a hardened instance in a public subnet. You then route SSH traffic through it to reach private servers. Teams often use this relay host pattern to keep internal machines off the public internet. Still, broad SSH keys and shared system accounts often give users too much network reach. Once an engineer logs in, they can often reach every server in the private subnet. How an amazon linux relay host works in practice A relay host acts as a single e
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 an amazon linux relay host by placing a hardened instance in a public subnet. You then route SSH traffic through it to reach private servers. Teams often use this relay host pattern to keep internal machines off the public internet. Still, broad SSH keys and shared system accounts often give users too much network reach. Once an engineer logs in, they can often reach every server in the private subnet.
How an amazon linux relay host works in practice
A relay host acts as a single entry point for your private cloud network. You place the Amazon Linux instance inside a public subnet with an internet route. Your database servers and app nodes sit inside private subnets with no public IP addresses. Security groups on the public host allow inbound SSH traffic only from trusted office networks. Security groups on the private servers only accept SSH traffic coming from the relay host.
To log in, an engineer first connects to the public Amazon Linux machine. Instead of storing private keys on the relay host, teams use SSH agent forwarding. Agent forwarding lets your local machine answer key checks for the final private server. Modern SSH setups also let you jump through the intermediate host in one step. The client opens an encrypted tunnel through the relay host directly to the target node.
Teams also harden the Amazon Linux instance by removing unneeded packages and shells. Admins disable root login and turn off password checks in the SSH service settings. Many teams sync public keys from their cloud identity tool to manage user accounts. They also enable system logs to track which user IP connected at what time.
What native SSH relay setups solve and where they fall short
A well-built relay host stops attackers from scanning your private servers from the internet. It shrinks your public attack surface down to a single hardened Amazon Linux machine. Network teams only need to watch and patch one entry point for outside traffic. This setup works well for basic network isolation and perimeter defense.
Still, a traditional SSH relay only checks who can open the network tunnel. Once the SSH tunnel starts, the relay host cannot read the traffic inside it. It does not know what commands an engineer runs on the target server. If a developer has login rights to a host, they can run any command there. They might restart a live service by mistake or read raw data files.
Static SSH keys also create long-term risk when team members change roles or leave. Revoking access means finding and removing keys across every target machine or directory. Native system logs on the relay host only show connection start and end times. They do not capture the actual shell actions or protect sensitive fields like emails or phone numbers. Teams need controls that inspect commands in flight and apply rules per action.
End-to-End Encryption + Linux Capabilities Management: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
Managing host permissions and user keys at scale
As your server fleet grows, managing local Linux users on every host becomes hard. Teams often start by copying authorized key files to new instances during boot. When someone leaves the team, admins must run scripts to wipe their keys everywhere. If one server misses the update, that old key still works through the relay.
Some teams switch to SSH certificates signed by a central certificate authority. The relay host and private servers trust the authority key instead of individual user keys. Users get a short-lived certificate after they log in to their identity provider. This removes the need to push public keys out to every single Amazon Linux machine.
Even with short-lived certificates, Linux still maps the user to a local system account. Everyone who maps to the admin role gets the exact same broad shell rights. You still cannot block a risky command or mask card numbers in command output. True safety requires checking each action and hiding sensitive values before they reach the screen.
Check database and API queries on the wire
Identity tools, roles, and network rules decide who opens a session. Setup alone cannot check what each query does or mask sensitive values in a response once a session starts. When workflows touch Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes APIs, SSH, or internal HTTP APIs, hoop.dev sits inline in the wire protocol beside those services as an open-source proxy, a sidecar for your Postgres or API. On every query an AI agent or engineer runs against production, hoop.dev decides to pass, mask, block, or hold it for human review.
Your login details and client tools stay as they are while hoop.dev guardrails refuse bad deletes or drops before they run, and hoop.dev data masking rewrites matched sensitive values in responses in memory. Furthermore, hoop.dev holds SOC 2 Type II, is MIT licensed, and writes every query and decision to an audit trail that generates evidence for HIPAA, GDPR, and PCI DSS. See the source on GitHub.
Frequently asked questions
Should I store private SSH keys on the Amazon Linux relay host?
No, never store private keys on the relay host itself. If an attacker compromises that public host, they can steal every key stored there. Always keep private keys on the user workstation and forward the connection instead.
How is an SSH relay host different from a VPN?
A VPN puts the user device onto the private network across many ports. An SSH relay host only forwards SSH traffic to specific target machines. This gives you a narrower network path than a full network tunnel.
Can a standard SSH relay host log the commands users run?
No, because the final SSH session is encrypted between the user client and target server. The relay host only passes encrypted packets back and forth across the network. It cannot see or control the shell commands running inside that encrypted stream.
Related guides
In this post