A Unix Utility You Should Know About: Netcat (2009)
catonmat.net
catonmat.net
You can find out more about it: http://nmap.org/ncat/
Depending on the nc app you have installed on your machine, params will have to be passed using different flags or in differing orders (someone should post why there are different kinds of netcat, I forget). Ncat accepts either format, and sends you cards on your birthday.
Also, fping is an excellent ping sweeper if that's all you need (and it's now being updated again).
Edit: somehow my phone managed to post this comment three times. I've deleted the others
-W host:port
Requests that standard input and output on the client be
forwarded to host on port over the secure channel. Implies -N,
-T, ExitOnForwardFailure and ClearAllForwardings. Works with
Protocol version 2 only.Also worth noting this is also extremely useful when used in your ~/.ssh/config file.
Host <bastion>
Hostname <bastion>
User gateway
ForwardAgent yes
Host 10.0.*
User <username>
ProxyCommand ssh -W %h:%p <bastion>
Where bastion is the NAT/Bastion SSH host for my infrastructure. 10.0.* are internal IP addresses, which don't work on my network, but get passed through to the bastion (where they do work). Pretty handy as I can just "ssh <internal address>"It is the first major occasion where Unix went in a completely wrong direction. The second one was the X server.
Is there some rash of people opening up public listening ports using netcat to... run a service of some sort? Most of the time when I need an arbitrary connection between unix machines ssh in command (not even port forward) mode is more than enough.
nc, netcat, ncat, socat... I can never be sure of which syntax I'm going to get on an unfamiliar server.
* the original netcat (http://nc110.sourceforge.net/)
* OpenBSD netcat
* "GNU netcat" (not affiliated with GNU)
* BusyBox netcat
* Nmap ncat (well, this one is typically always "ncat")
They all take roughly the same, but different, syntax, like 'cp', 'ls', or any of the *nix utilities with multiple implementations.https://github.com/pflanze/chj-bin/blob/master/netcat-get https://github.com/pflanze/chj-bin/blob/master/netcat-push https://github.com/pflanze/chj-bin/blob/master/netcat-receiv... https://github.com/pflanze/chj-bin/blob/master/netcat-serve-...
(They use 'have' from here: https://github.com/pflanze/chj-bin/blob/master/have )
[1] for example my way to transfer files between servers: https://github.com/pflanze/chj-bin/blob/master/netoffer (which depends on netfetch from the same place)