How to Configure Rocky Linux Relay Host
You set up a rocky linux relay host by enabling SSH forwarding on an intermediate server. Next, you update client SSH rules to route traffic through that machine. Teams use this relay host setup to reach private servers inside locked networks. Still, broad SSH roles on the relay often grant too much network reach. One stolen key can expose every internal server behind that entry point. How a rocky linux relay host works A rocky linux relay host sits between external users and private backend
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 a rocky linux relay host by enabling SSH forwarding on an intermediate server. Next, you update client SSH rules to route traffic through that machine. Teams use this relay host setup to reach private servers inside locked networks. Still, broad SSH roles on the relay often grant too much network reach. One stolen key can expose every internal server behind that entry point.
How a rocky linux relay host works
A rocky linux relay host sits between external users and private backend servers. Engineers do not log in to private machines straight from their laptops. Instead, their SSH client makes a secure hop through the public relay server. The relay checks the user key and forwards the traffic to the final host.
To build this setup, admins harden a minimal Rocky Linux server at the network edge. They turn off root login and require public key checks for every user. Admins also adjust SSH daemon rules so the host forwards TCP sessions without storing keys. A local firewall limits incoming traffic to the SSH port from known office networks. Outbound firewall rules restrict which private subnets the relay can reach.
On the client side, engineers configure their local SSH settings to use this relay host. The client opens an encrypted tunnel through the relay to the target server. The private server then checks the user key before starting a shell session. This design keeps private servers off the public internet while allowing remote work.
Managing SSH keys and user accounts
Running a relay host requires strict control over Linux user accounts and SSH keys. Many teams start by placing static public keys onto the relay and target servers. When an engineer joins the team, admins copy their key to multiple machines. When someone leaves, admins must find and delete that key from every single host.
If admins miss an old account on the relay, a former worker retains network reach. To reduce this risk, some teams set up an SSH certificate authority. The authority signs user keys for a short period based on central directory groups. Servers trust the authority signature instead of checking long lists of static user keys.
Even with certificates, admins must still manage Linux accounts and sudo rules on each host. Group mappings on the server decide who gets a basic shell or full root rights. Keeping these local group files updated across hundreds of Rocky Linux hosts takes constant work.
End-to-End Encryption + Linux Capabilities Management: architecture patterns and best practices
Continue reading? Get the full guide.
Free. No spam. Unsubscribe anytime.
What native SSH relaying solves and what it misses
A Rocky Linux relay host reduces your public attack surface right away. You only expose one hardened SSH port instead of dozens of private servers. Central firewall rules become much simpler to write, check, and maintain. You also get a single network choke point to watch incoming connection attempts.
Still, a standard SSH relay only decides who can open a network tunnel. Once the encrypted session starts, the relay is blind to the traffic inside. It cannot see which shell commands an engineer runs on the target server. It also cannot stop a user from running destructive scripts or reading private files.
Native system logs on the relay only record login times and source IP addresses. To see actual commands, admins must gather audit logs from every backend server. If an attacker gains root on a target host, they can alter those local logs. Native SSH forwarding gives you network entry control, not command-level safety or clean audit trails.
Add runtime guardrails and masking beside your databases and APIs
Login rules, role grants, and CI checks govern who connects to your stack. Yet any allowed script, engineer, or AI agent still runs commands with the full scope of its role. For workloads on Postgres, MySQL, SQL Server, MongoDB, ClickHouse, Kubernetes, SSH, or internal HTTP services, hoop.dev sits inline in the protocol beside the service as an open-source proxy, a sidecar for your database or API. On every production query an agent or human runs, hoop.dev decides whether to pass, mask, block, or escalate it for review.
Before a query runs, hoop.dev guardrails check the statement against your rules, an AI Analyzer you configure can score intent or hold risky calls for human approval, and hoop.dev data masking rewrites sensitive fields in responses in memory. Explore the MIT-licensed project on GitHub.
Frequently asked questions
Should I store private SSH keys on the Rocky Linux relay host?
No, you should never store private SSH keys on the relay server itself. If an attacker compromises the relay, they can steal those keys and reach every target. Always keep private keys on client machines and use relay host forwarding instead.
What is the difference between agent forwarding and relay host forwarding?
Agent forwarding lets the remote server use your local SSH agent socket during a session. A root user on the relay can hijack that socket and impersonate you elsewhere. Relay host forwarding tunnels the encrypted traffic straight through the relay without exposing your agent.
How do I limit which internal servers a user can reach through the relay?
You can restrict target hosts and ports inside the SSH daemon settings on the relay. Admins apply these rules to specific Linux users or groups to limit network hops. You can also use local firewall rules to block traffic to sensitive subnets.
Related guides
In this post