Stop fighting with nested SSH sessions when you need to run one command
Environment & Shell Customization (Aliases/Functions/.Bashrc)
Stop fighting with nested SSH sessions when you need to run one command
🧩 The Challenge
Dealing with a jump host that requires another jump host is a special kind of hell when you’re just trying to run a quick grep on a log file. You end up typing ten minutes of command strings and inevitably typo one of them.
💡 The Fix
Just define a persistent shell function that uses the ProxyJump flag to tunnel your connection through as many layers as you need without the manual headache. It saves you from having to remember which server connects to which subnet.
jump() { ssh -o ProxyJump=$1 $2; }
⚙️ Why It Works
Setting up the proxy at the SSH config layer instead of nesting manually handles the authentication handshake for you automatically. Because it’s passed as an option, the remote server doesn’t even know it’s being proxied through that middle node.
🚀 Pro-Tip: Add Host sections to your ~/.ssh/config file for your jump hosts so you only have to type the nickname instead of the full FQDN.
Linux Tips & Tricks | © ngelinux.com | 8/18/2026
