Solved

Which process is using the port?

Posted on 2006-07-22
3
1,663 Views
Last Modified: 2013-12-27
How can i find id of a process listening on a specific port.

e.g
I do a nestat on my sytem

> netstat -an | grep 10886
10.234.52.64.10886         *.*                0      0 49152      0 LISTEN


How can I know what process id is using port 10886?
0
Comment
Question by:rohit_kapil
3 Comments
 
LVL 10

Expert Comment

by:Nukfror
ID: 17161383
The easiest way to figure this out is to install lsof.  You can get it from either www.blastwave.org or www.sunfreeware.com.  

If you're on Solaris 10, pfiles finally the ability to show clearly what network ports a specific application has open.  The issue is you need to run pfiles against every PID on the system to figure out which app has a port open.
0
 
LVL 5

Expert Comment

by:devrick0
ID: 17162810
Yeh, with previous versions of solaris, the cleanest way short of developing a script, is to use:
lsof -i:portnumber

so to check for PIDs associated with ssh (assuming you're running it on the default port):
lsof -i:22
0
 
LVL 38

Accepted Solution

by:
yuzh earned 50 total points
ID: 17164831
You can use my script in http:Unix/Q_21151689.html#12196145 
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
create user in TSM 7 589
llcommand 6 87
Invalid password trying to cannect to Unix server 2 69
problem creating new luks volume on new VM disk 5 77
Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
I have been running these systems for a few years now and I am just very happy with them.   I just wanted to share the manual that I have created for upgrades and other things.  Oooh yes! FreeBSD makes me happy (as a server), no maintenance and I al…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now