Ever need to jump your ssh through an intermediate host? You may be familiar with using netcat like this in your
ProxyCommand ssh -q jump-host nc destination-host %p
ProxyCommand runs on our local machine. The command must open a tcp connection that
ssh may then use for the session. Here we shell into our
jump-host, connecting the file descriptors to
nc, which will forward all data to
%p, the port you provided to
-p on the cli.
Clear as mud, no?
Another slightly more readable way to achieve this is with
ProxyCommand ssh -W destination-host jump-host
This works the same way as the
nc version, but now we are using
ssh’s internal implementation of
nc. So one less dependency on the jump host.
But behold, the most legit and legible version of jumping hosts:
So same thing, but now the words say what it does.
When you get lost remember that
.ssh/config has it’s own man page:
$ man ssh_config