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 :-).

3 Comments

Linear

  • Alex  
    This in not needed anymore with introduction of:

    "ssh(1): Add a ProxyJump option and corresponding -J command-line flag to allow simplified indirection through a one or more SSH bastions or "jump hosts".

    http://www.openssh.com/txt/release-7.3
  • education online courses  
    I know this web page provides quality based articles or reviews and other data, is there any other web page which gives these kinds of data in quality?
  • online learning  
    Hey there just wanted to give you a quick heads up. The words in your article seem to be running off the screen in Chrome. I'm not sure if this is a formatting issue or something to do with web browser compatibility but I thought I'd post to let you know. The design and style look great though! Hope you get the issue solved soon. Many thanks

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
Standard emoticons like :-) and ;-) are converted to images.

To prevent automated Bots from commentspamming, please enter the string you see in the image below in the appropriate input box. Your comment will only be submitted if the strings match. Please ensure that your browser supports and accepts cookies, or your comment cannot be verified correctly.
CAPTCHA