SSH Cheat Sheet/ProxyCommand with netcat

Tunnel through another host using ProxyCommand.

Section: Jump Hosts and Proxies

ProxyCommand with netcat

bash
bash
ssh -o ProxyCommand='ssh bastion.example.com -W %h:%p' user@private.internal
Explanation

Tunnel through another host using ProxyCommand.

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
Chain multiple jump hosts
Traverse more than one bastion.
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