SSH Cheat Sheet/Chain multiple jump hosts

Traverse more than one bastion.

Section: Jump Hosts and Proxies

Chain multiple jump hosts

bash
bash
ssh -J bastion1.example.com,bastion2.example.com user@private.internal
Explanation

Traverse more than one bastion.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Jump Hosts and Proxies
Connect through a jump host
Reach an internal host via a bastion.
OpenIn sheetbashsame section
ProxyCommand with netcat
Tunnel through another host using ProxyCommand.
OpenIn sheetbashsame section
Forward stdio to another host
Use -W for direct stream forwarding.
OpenIn sheetbashsame section
Connect to a host
Open an interactive SSH session.
OpenIn sheetbash1 tag match
Use a specific private key
Choose a private key explicitly.
OpenIn sheetbash1 tag match
Start a master connection
Open a reusable control connection for later sessions.
OpenIn sheetbash1 tag match