nc is a command-line tool called Netcat. It’s a very versatile network utility used to read and write data over network connections, using both the TCP and UDP protocols.

You can use nc to transfer files between two machines over the network.

You can use nc to scan open ports on a remote machine.

nc listens for TCP messages if nothing is specified, with the -u option (only UDP)

Concept you should know: what is 0.0.0.0

0.0.0.0 is a special IP address known as the “listening on all interfaces address” or “binding to all interfaces address”

If you hear 0.0.0.0 it means that it is listening on all available network interfaces on the machine.

When a server is listening on 0.0.0.0, it can receive connections from any network interface on the machine, not just the loopback interface or localhost.

On the server, where you will receive the TCP message, you must create a server with nc that listens on port 8080

nc -l 0.0.0.0 8080

creates a Netcat server that listens on port 8080 on all available network interfaces on the machine.

On your PC with router you must send a TCP message to port 8080 to the VPS

nc <the IP of the VPS> 8080

all together (I’m connected to the VPS via ssh)

As you can see, the server is listening on port 8080.

In the console on the right I am connected to the VPS via SSH.

From my personal PC I send a message to the VPS server with content “3”.

The VPS server receives the message “3” sent from my PC.