Quit leaking your internal network topology via SSH agent forwarding
Technical Briefing | 11/13/2026
You probably have that one bastion host you use to jump into the rest of your fleet. You use Agent Forwarding because it is convenient; you just ssh from your workstation and then from the bastion, your keys are just magically there. I have seen this setup in almost every shop I have audited. But it is a massive security hole that lets any root user on that bastion host hijack your socket and impersonate you anywhere else on your network.
Why the socket is a ticking time bomb
When you enable ForwardAgent yes in your config, the SSH client creates a UNIX domain socket on the remote server. The remote sshd process then proxies the authentication requests back to your local agent. Any user with root access on that server can read that socket file, effectively acting as you. If your bastion is compromised, the attacker does not need to crack your keys; they just ride your active session into the rest of your infrastructure.
ProxyJump jumpbox@bastion.example.com
- Use ProxyJump instead of agent forwarding to keep your keys strictly local
- ProxyJump allows you to chain connections without exposing the socket to the intermediate server
- Audit your ~/.ssh/config for ForwardAgent directives and delete them immediately
Most engineers keep using forwarding because they think ProxyJump is some complex feature. It is not. It is just a more secure way to tell your local client to tunnel the connection through the bastion. Your keys never leave your workstation, and if the bastion host is owned, your access to the downstream servers stays intact. It is a tiny change to your config file that keeps your credentials exactly where they belong.
