Networking Forums  

Go Back   Networking Forums > Networking Newsgroups > Linux Networking

Tell what process is running on port

Reply
 
Thread Tools Display Modes
  #1  
Old 10-08-2004, 05:02 AM
Default Tell what process is running on port



Hi,

How can I tell what process is runinning on a spesific port? For example
when I run netstat -n, it gave me this result:
tcp 0 0 210.188.XX.XX:44913 202.4.XX.XX:25 TIME_WAIT

I want to know what process is that. Is it possible? Please help. Thank
you.

--Vito


Vito Corleone
Reply With Quote
  #2  
Old 10-08-2004, 05:04 AM
ynotssor
Guest
 
Posts: n/a
Default Re: Tell what process is running on port

"Vito Corleone" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m

> How can I tell what process is runinning on a spesific port? For
> example when I run netstat -n, it gave me this result:
> tcp 0 0 210.188.XX.XX:44913 202.4.XX.XX:25
> TIME_WAIT
>
> I want to know what process is that. Is it possible? Please help.


man netstat

Pay attention to the -p option. Pay attention to the man page for any
command of interest, please.

tony

--
use hotmail for email replies

Reply With Quote
  #3  
Old 10-08-2004, 05:56 AM
Vito Corleone
Guest
 
Posts: n/a
Default Re: Tell what process is running on port

Hi Tony,

> man netstat
>
> Pay attention to the -p option. Pay attention to the man page for any
> command of interest, please.


Thank you for your reply. Sorry I should have checked man first. Anyway,
I tried -p option, but there was nothing in PID/Program Name column. It
looks like:

tcp 0 0 210.188.XX.XX:37257 192.76.XX.XX:25
TIME_WAIT -

I think this is because the connection is in TIME_WAIT status? Any other
way to do this? Thanks.

-Vito
Reply With Quote
  #4  
Old 10-08-2004, 06:14 AM
ynotssor
Guest
 
Posts: n/a
Default Re: Tell what process is running on port

"Vito Corleone" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m

> Anyway, I tried -p option, but there was nothing in PID/Program Name
> column. It looks like:
>
> tcp 0 0 210.188.XX.XX:37257 192.76.XX.XX:25
> TIME_WAIT -
>
> I think this is because the connection is in TIME_WAIT status? Any
> other way to do this? Thanks.


Run the netstat command as root to get process identification.

Also use (if installed on the box) as root for more details:

lsof -p ` lsof -i :37257 | awk '! /COMMAND/ {print $2}' `


tony
--
use hotmail for email replies
Reply With Quote
  #5  
Old 10-08-2004, 06:28 AM
ynotssor
Guest
 
Posts: n/a
Default Re: Tell what process is running on port

"Vito Corleone" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed) m

> tcp 0 0 210.188.XX.XX:44913 202.4.XX.XX:25
> TIME_WAIT
> tcp 0 0 210.188.XX.XX:37257 192.76.XX.XX:25
> TIME_WAIT -


I failed to mention that since the "Foreign Address" columns of your 2
examples are using port 25, most likely the process that is of concern to
you is your local MTA (sendmail, postfix, exim, whatever) connecting as a
client to other MTAs.


tony

--
use hotmail for email replies

Reply With Quote
Reply

Tags
port, process, running

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 02:21 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.