SSH & Remote Administration
Stop manually hopping through jump boxes
🧩 The Challenge
Ever needed to hit a server deep inside a network, so you SSH to one box, then from there you SSH to the next, and maybe even a third? It’s a total pain to copy files that way, and your terminal history gets messy fast. And if one of those connections drops, you’re starting all over again.
💡 The Fix
Forget that multi-hop dance. SSH has a proper way to bounce through multiple hosts in one shot. Your local machine connects directly to the final target, just via the proxy. This cleans up your workflow big time and lets scp just work without any shenanigans.
ssh -J user@jumphost.example.com user@targethost.example.com
# For multi-hop through several jumps:
ssh -J user@jumphost1.example.com,user@jumphost2.example.com user@targethost.example.com
# Or, even better, put this in your ~/.ssh/config:
# Host targethost.example.com
# ProxyJump user@jumphost.example.com
# User your_target_user
⚙️ Why It Works
The -J flag (or ProxyJump in your config) tells SSH to establish a tunnel through the intermediary host(s) and then create the final connection through that tunnel. Your local SSH client manages all the handshakes behind the scenes. And this way, your local machine always thinks it’s talking directly to the target.
🚀 Pro-Tip: Put this in your ~/.ssh/config file. Your future self will thank you when you can scp directly to those internal machines.
Linux Tips & Tricks | © ngelinux.com | 9/23/2026
