[NCLUG] User process to IP address

J. Paul Reed preed at sigkill.com
Thu Sep 20 11:12:51 MDT 2001


On Thu, 20 Sep 2001, C. J. Keist wrote:

>      I'm trying to find a way to associate client machines IP address
>      connected to my server to the user process running on it.  I've been
>      looking at lsof to do this, but no luck with it.

I'm a little confused here... so, you want to be able to say "IP address
10.3.43.2 is connected to me on port 43299" and you want to find the PID of
the application on *your* machine talking on port 43299?

Try fuser.

fuser -n tcp 43299 (or fuser -n udp).

For instance:

[preed at excelsior preed]$ netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State
...
tcp   0      0 excelsior-int.sigk:2082 brai60075.halls.co:2848 ESTABLISHED
...

[preed at excelsior preed]$ fuser -n tcp 2082
2082/tcp:            19009 19010 19011 19012 19013
[preed at excelsior preed]$ ps -ef | grep 19009
preed    19009     1  0 Sep18 ?      00:00:00 licq -p qt-gui -- -g WINDOWS
preed    19010 19009  0 Sep18 ?      00:00:00 licq -p qt-gui -- -g WINDOWS
[preed at excelsior preed]$

Did I understand your question correctly?

Later,
Paul
   ---------------------------------------------------------------------
   J. Paul Reed               preed at sigkill.com || web.sigkill.com/preed
   It's amazing what a little brain damage will do for your credibility.
                                              -- Leonard Shelby, Memento




More information about the NCLUG mailing list