943,525 Members | Top Members by Rank

Jul 12th, 2008
0

enquiring the status of a port

Expand Post »
hi,
can any one please tell me, if I want to check that if any particular port on a remote workstation is open or closed on a LAN which command should I use ? If the ping command can be used please tell me its syntax.

regards
pdwivedi
Reputation Points: 8
Solved Threads: 0
Light Poster
pdwivedi is offline Offline
37 posts
since Oct 2007
Jul 15th, 2008
0

Re: enquiring the status of a port

Use either or both of these commands to find out if a port is already taken by a service:

netstat -A inet -lnp

lsof -i tcp:the_port_you_are_inquiring_about

For example, if I wan to know if port 8080 is already taken, I do:

netstat -A inte -lnp
I then search on the output to see if a service is already listening on port 8080.

I also use the other one:

lsof -i tcp:8080

If you get a response, then another service is listening on port 8080 and you cannot use it.
However, if you get no response, then it is free to use. No service is listening on port 8080.

Thanks.
--Willie
Reputation Points: 10
Solved Threads: 0
Light Poster
williebens is offline Offline
42 posts
since Jan 2008
Jul 23rd, 2008
0

Re: enquiring the status of a port

or you can simply use nmap
Moderator
Featured Poster
Reputation Points: 183
Solved Threads: 89
Posting Virtuoso
DimaYasny is offline Offline
1,772 posts
since Jan 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Linux Servers and Apache Forum Timeline: Desperately need Sendmail help!
Next Thread in Linux Servers and Apache Forum Timeline: LAMP instalisation





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC