How to see if a port is open on a Linux system using netcat.

Posted: June 23, 2014. At: 12:35 PM. This was 3 years ago. Post ID: 7436
Page permalink: http://securitronlinux.com/bejiitaswrath/how-to-see-if-a-port-is-open-on-a-linux-system-using-netcat/

Now, we must convince Congress to stop the FCC. Can you display an alert?

The netcat command is a program for querying network connections. This little program may be used to query whether a port is open on a Linux system or not.

Here I am determining whether port 443 is open on this Linux Mint machine.

homer@deusexmachina ~ $ nc -zv localhost 443
Connection to localhost 443 port [tcp/https] succeeded!

And it was, I was successful!

If I try to connect to port 22, it will not work as SSH is configured on port 443.

homer@deusexmachina ~ $ nc -zv localhost 22
nc: connect to localhost port 22 (tcp) failed: Connection refused

This trick also works on remote hosts.

homer@deusexmachina ~ $ nc -zv yahoo.cn 443
Connection to yahoo.cn 443 port [tcp/https] succeeded!

So give this a try for yourself, this is very useful, and quicker than an nmap scan.

1 responses to “How to see if a port is open on a Linux system using netcat.

Leave a Reply