It's common to use
netcat utility to work with SSH ProxyCommand, which allows to use a bridge server, very useful when you need to connect directly to a host behind a firewall. Example:
# File: ~/.ssh/config Host workbox HostName 192.168.1.92 # The ip address that the bridge server can see User anotherusername IdentityFile ~/.ssh/id_rsa ProxyCommand ssh [email protected] nc -w 120 %h %p
I was using
netcat until a couple of days, and works very smooth. Then I've setup a new server on another private network, behind a CentOS 7 firewall, and when I've tried the configuration above, I got this:
Ncat: Since April 2010, the default unit for -w is seconds, so your time of "120" is 2.0 minutes. Use "120ms" for 120 milliseconds. QUITTING.
$ nc --help Ncat 6.40 ( http://nmap.org/ncat ) Usage: ncat [options] [hostname] [port] Options taking a time assume seconds. Append 'ms' for milliseconds, 's' for seconds, 'm' for minutes, or 'h' for hours (e.g. 500ms).
Then, in my SSH configuration I had to change the
-w param to add the time unit (
ProxyCommand ssh [email protected] nc -w 120m %h %p