SSH & Remote Administration
Stop your SSH agent from clobbering your session when you jump between servers
đ§© The Challenge
Dealing with SSH agent forwarding is usually fine until you realize youâve left your local keys exposed on a jump box you just compromised or abandoned. Itâs a security headache thatâs bitten me more than once when Iâve had to audit a dozen boxes after a contractor left.
đĄ The Fix
Use ProxyJump instead of agent forwarding to keep your keys safely on your local machine. It moves the traffic through the middle server without handing over your authentication credentials.
ssh -J user@jumpbox.example.com user@target-server.com
âïž Why It Works
This tells your local SSH client to act as a bridge, setting up a secure pipe directly to the final host. Because the jump server never sees your private keys, you donât have to worry about them getting hijacked if that intermediate box is untrustworthy.
đ Pro-Tip: Stick âProxyJump jumpboxâ into your ~/.ssh/config for that specific host and stop typing the command entirely.
Linux Tips & Tricks | © ngelinux.com | 8/10/2026
