Hopping through a bastion
ProxyJump lets you reach a target host by first connecting through an intermediate host (a "jump host" or "bastion"). Common pattern when internal servers aren't directly reachable from the internet — you SSH to the bastion, then from there to the internal host. ProxyJump automates the two-step.
Command line vs config
You can use it ad-hoc with -J, or bake it into ~/.ssh/config with the ProxyJump directive.
Why it's better than agent forwarding
Two ways to hop through a bastion:
- Agent forwarding (
-A) — your local agent socket is exposed on the bastion. Anyone with root there can use it to authenticate as you elsewhere. - ProxyJump (
-J/ProxyJump) — your local SSH client opens a TCP tunnel through the bastion to the target, then runs a fresh SSH negotiation with the target. The bastion just shuffles encrypted bytes; your key never enters the bastion in any usable form.
Default to ProxyJump. Use agent forwarding only when ProxyJump genuinely doesn't fit and you trust the bastion completely.