Is there a way to determine what program is listening to some port, TCP or UDP, in Linux?

link|improve this question

feedback

4 Answers

up vote 5 down vote accepted
netstat -lp

is the command you want, but you need to be root to see all the data.

link|improve this answer
Thanks. Didn't thought about reading netstat docs... – whitequark Jan 21 '10 at 15:46
feedback

ss -tlp

Quicker than netstat.

link|improve this answer
nice.. i didnt know about this command.. – shadyabhi Jan 22 '10 at 13:12
feedback

Take a look at this and this page.

link|improve this answer
lsof trick is cool, thanks – whitequark Jan 21 '10 at 15:48
You're welcome. – Mehper C. Palavuzlar Jan 21 '10 at 15:49
feedback

Already answered, but if it's on a system you don't have a shell on, running nmap -sV -p <port number> <target> will often give you the answer. Add -sU if scanning a UDP port.

link|improve this answer
I know about nmap... anyway, I didn't wrote it in question, so +1. – whitequark Jan 24 '10 at 17:33
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.