3 ms·
You should also know about the so-called "netcat mode" in OpenSSH: -W host:port Requests that standard input and output on the client be forwa
by ams6110 13y ago
You should also know about the so-called "netcat mode" in OpenSSH:
-W host:port
Requests that standard input and output on the client be
forwarded to host on port over the secure channel. Implies -N,
-T, ExitOnForwardFailure and ClearAllForwardings. Works with
Protocol version 2 only.
- jwilliams 13y agoI only discovered this recently - I was using a literal "nc %h %p" rather than this shortcut. Also worth noting this is also extremely useful when used in your ~/.ssh/config file.
- voltagex_ 13y agoCan you give an example of how you'd use it in your config?
- jwilliams 13y agoSure. I have something like: Host <bastion> Hostname <bastion> User gateway ForwardAgent yes Host 10.0.* User <username> ProxyCommand ssh -W %h:%p <bastion> Where bastion is the NAT/Bastion SSH host for my infrastructure. 10.0.* are internal IP addresses, which don't work on my network, but get passed through to the bastion (where they do work). Pretty handy as I can just "ssh <internal address>"
- voltagex_ 13y agoThanks!