In this post i am going to explain about how to find a port is opened or in remote Linux / Unix box.
This may be achieved by using three command prompt tool. They are
- nmap and
Using the telnet command we may trace whether the remote machine port is opened or not.
Sample example is given below
[root@client ~]#telnet yahoo.com 443
Connected to yahoo.com (126.96.36.199).
Escape character is ‘^]’.
If the output is like connected to yahoo.com(remote machine) and in the next line Escape character is ‘^]’ . It clearly tells that 443 is a open port for domain yahoo.com
[root@client ~]# telnet yahoo.com 22
telnet: connect to address 188.8.131.52: Connection timed out
In the above example i am trying to find whether ssh port 22 is opened for yahoo.com(remote machine).
Its showing Trying 184.108.40.206(server IP) and connection timed out. It clearly shows that the remote host is not reachable.
Using the nc command also we may trace whether the remote host port is opened or closed.
Sample example is given below.
[root@client ~]# nc -z google.com 80
Connection to google.com 80 port [tcp/http] succeeded!
-z —–> Specifies that nc should just scan for listening daemons, without sending any data to them.
nmap is the best way to find the port check. It shall gives you all the details you are expecting.
Sample example for nmap.
[root@client ~]# nmap -v -A -p 80,443 google.com