I am trying to use netcat to relay SSH traffic (bidirectionally) from port 2222 on one host to port 22 on a different host. For test purposes, I redirect to 127.0.0.1:22 here instead of the remote host.
Here is the command and the error I am getting:
nc -n –l 2222 0<backpipe | nc -n 127.0.0.1 22 1>backpipe
getaddrinfo: Name or service not known
I must be missing something really obvious here, but I fail to see it. I am using only IP addresses (and even "-n" to not resolve anything), but it appears to still be trying to do a DNS lookup.
This is CentOS 6.x [64].
What am I missing?