Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to check if a certain port is open on server?

Just as you'd ping an IP of to a server to check if it is up, can we also check if, on that running server, a port is active/open?

this just comes from my head,but can you be more specific in your ping statement?

 `ping 127.0.0.1:7004`

I know this command is not allowed, but is there a way to check for this in Linux and Windows?

like image 658
kholofelo Maloma Avatar asked Jun 04 '15 05:06

kholofelo Maloma


2 Answers

If you are willing and able to install software, you can use nmap

nmap -p 7004 127.0.0.1

Or if it is internet facing, use a web service such as http://www.yougetsignal.com/tools/open-ports/

like image 161
pcnate Avatar answered Sep 28 '22 08:09

pcnate


That depends upon your access to system (client or server), You can use either of two options,

  1. Server side you can use netstat -an to check which ports are listening
  2. From outside use just telnet host port, if it is not working on linux machines try telnet host:port.
like image 25
Amit Avatar answered Sep 28 '22 06:09

Amit