[NCLUG] User process to IP address

Aaron D. Johnson adj at ccltd.com
Thu Sep 20 09:55:28 MDT 2001


>      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.  This is
> what I have been trying to do:
> 
>      lsof -i @IP_address
>      lsof -i @IP_address:port
> 
> I get the IP and port from netstat.
> 
> But it comes up empty.  Does anyone know of a way of doing this?

I'd try the '-p' switch to netstat.  You'll need to be root, but I'm
pretty sure the same holds true for lsof.  Not sure when the -p switch
was added, but this one has it:

    $ netstat --version
    net-tools 1.54
    netstat 1.38 (1999-04-20)

HTH.

Aaron



More information about the NCLUG mailing list