Written by
on
on
Network in the Shell - revisited
My long-time reader Lars Timmann pointed me to a another really cool usecase of the /dev/tcp pseudo device in the bash shell. You can use it to proxy ssh connections though a jump host without the need to have nc
on it. He writes in a Facebook comment:
I use it in ~/.ssh/config like this:
--------------X8------------------------------------------
Host host-a
ProxyCommand ssh host-b "/bin/bash -c 'exec 3<>/dev/tcp/%h/%p; cat <&3 & cat >&3;'"
--------------X8------------------------------------------
So there i no need for netcat on any host to use it as jump host <img src="http://blog.moellenkamp.org/plugins/serendipity_event_emoticate/img/emoticons/smile.png" alt=":-)" class="emoticon" />.