Let's say, i'd like to know whether certain port (e.g. 21) is open or closed.
What is the best shell command for that?
|
Let's say, i'd like to know whether certain port (e.g. 21) is open or closed. What is the best shell command for that? |
|||||
|
|
My favorites are: From a local machine
From a remote box
|
|||||||||
|
|
You can also show all current connections:
See the manpage for loads more, netstat is a very powerful tool :) |
|||
|
|
It even shows you OS version and the service on that port |
|||
|
You can use
tries to connect to port 21 on somehost.example.com If the port is closed you get a message like
otherwise you'll see whatever the program listening on that port tells you on connect. |
|||
|
|