What is listening at given port?

8

1

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

whitequark

Posted 2010-01-21T15:43:47.123

Reputation: 14 146

Answers

5

netstat -lp

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

Michael Kohne

Posted 2010-01-21T15:43:47.123

Reputation: 3 808

Thanks. Didn't thought about reading netstat docs... – whitequark – 2010-01-21T15:46:52.997

2

ss -tlp

Quicker than netstat.

profy

Posted 2010-01-21T15:43:47.123

Reputation: 121

nice.. i didnt know about this command.. – Abhijeet Rastogi – 2010-01-22T13:12:32.980

1

Take a look at this and this page.

Mehper C. Palavuzlar

Posted 2010-01-21T15:43:47.123

Reputation: 51 093

1

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.

Dentrasi

Posted 2010-01-21T15:43:47.123

Reputation: 10 115

I know about nmap... anyway, I didn't wrote it in question, so +1. – whitequark – 2010-01-24T17:33:00.927