Re: tracing users ip address - Mailing list pgsql-general

From Kevin Brown
Subject Re: tracing users ip address
Date
Msg-id 20021218000023.GE20180@filer
Whole thread Raw
In response to tracing users ip address  ("Johnson, Shaunn" <SJohnson6@bcbsm.com>)
List pgsql-general
Johnson, Shaunn wrote:
> I don't know who this is, but, I'd like to know.  Is there a way
> I can track down the IP address of users trying to access
> the database?  I would imagine the debug that is running - currently
> I'm running debug level 2 ... seems that any  higher would
> slow my server down.

PostgreSQL listens on port 5432 by default.  So at the time the perp
is connected, you can do:

    netstat -an | grep ':5432.*ESTABLISHED'

and get a list of every IP address connected to your server at the
time.


This works for netstat under Linux, at the very least.  I expect the
output format under other flavors of Unix is close enough for the
above to work, but you may have to adjust it if your netstat output is
too different.

This won't tell you which one is the 'Admin' connection, but it may
help you to track down the perp anyway...


--
Kevin Brown                          kevin@sysexperts.com

pgsql-general by date:

Previous
From: Josh Berkus
Date:
Subject: Re: [NOVICE] [JDBC] JDBC - Open Office
Next
From: "Joshua D. Drake"
Date:
Subject: 2 gig file limit (yes I know, read anyway ;))