ProxyJump and Multi-Hop SSH Tunneling
You'll learn how to chain SSH connections through intermediate "bastion" hosts to reach destinations that aren't directly accessible.
What Is Multi-Hop SSH?
In secure network architectures, you often can't SSH directly to your target server. Instead, you must first connect to a bastion host (or "jump server"), then from there reach your final destination. Multi-hop tunneling automates this chain, letting you connect through one or more intermediaries in a single command.
Think of it like airline connections: you can't fly direct from your city to a remote village, so you take a connecting flight through a hub airport. The hub is your bastion host.
The ProxyJump Method
Modern SSH (version 7.3+) provides the ProxyJump option (-J) to simplify multi-hop connections:
ssh -J bastion.example.com user@internal-server.local
This tells SSH: "Connect to bastion.example.com first, then jump from there to internal-server.local." You can even chain multiple jumps:
ssh -J bastion1.com,bastion2.com user@final-destination
SSH Config File Approach
For permanent configurations, add to ~/.ssh/config:
Host internal-server
HostName internal-server.local
User user
ProxyJump bastion.example.com
Now ssh internal-server automatically routes through the bastion.
Security Considerations
- Authentication flows through each hop — ensure your SSH keys are properly configured
- Bastion hosts see connection metadata but not encrypted tunnel contents
- Use agent forwarding carefully (or avoid it) to prevent key exposure on intermediate hosts
- Each hop must have proper firewall rules allowing SSH traffic
Key Takeaway:
ProxyJump (-J) allows seamless multi-hop SSH connections through bastion hosts, enabling secure access to internal resources without manual re-authentication at each intermediate server.