|
|
#1 |
|
Prospect
Join Date: Jan 2002
Location: Boston
Posts: 10
|
determining ports that are in use
There was a similar post earlier about blocking a port over a LAN, but how can you find out which ports are in use, so you can block the offending port?
I seem to remember reading somewhere that there was a program you could run in the terminal that would report what ports were in use (and could also refresh at a user-defined interval), but I can't remember what that program is. Anyone out there know how I can determine what ports are in use on my computer? thanks in advance... |
|
|
|
|
|
#2 |
|
All Star
Join Date: Jan 2002
Location: CO, USA
Posts: 908
|
netstat -nf inet will show all current connections, TCP and UDP. netstat -anf inet will add listening ports to this; basically, the LISTEN port is where a server (or daemon) is sitting, waiting for a connection.
If you want to know which process is listening to a port, use lsof. For example: Code:
$ netstat -anf inet ... tcp 0 0 127.0.0.1.1033 *.* LISTEN Code:
$ sudo lsof -i :1033 ... netinfod 207 root 6u inet 0x01a9cd1c 0t0 TCP localhost:1033 (LISTEN) |
|
|
|
|
|
#3 |
|
Prospect
Join Date: Jan 2002
Location: Leeuwarden/ The Netherlands
Posts: 21
|
this is what I use
this command works great....
Read the manpage for more options... Code:
% lsof -i -n -P Good Luck Gwyrrdin
__________________
OS X= Beauty with Brains! |
|
|
|
|
|
#4 |
|
Prospect
Join Date: Jan 2002
Location: Boston
Posts: 10
|
Thanks for the tips everyone...
It turns out the program I wanted to block is using a random port everytime it starts up, so it's making it very difficult to do so. Oh well, at least I know how to take care of the static ones. Thanks... |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|