Test the connectivity to server using netcat
We can use netcat to test connections. Follow these steps:
If netcat is not installed, run:
#yum install nc
On the server, open the socket or port to test with the following command (as root):
#nc -l
On the client, run:
#nc
If you are not root on the client (netcat can only run as root), use telnet instead, as shown below:
$telnet
This method can be adapted to many tasks, including testing iptables or firewall rules, sending test email without the usual mail commands, and much more.
Note: All data sent from client to server is unencrypted, so this is not very safe for sensitive information.