Re: Using both ident and password in pg_hba.conf - Mailing list pgsql-general

From George Neuner
Subject Re: Using both ident and password in pg_hba.conf
Date
Msg-id jks3jb596lv5v6ogu57rgd7gf679kd7std@4ax.com
Whole thread Raw
In response to Using both ident and password in pg_hba.conf  ("D'Arcy J.M. Cain" <darcy@druid.net>)
Responses Re: Using both ident and password in pg_hba.conf  ("D'Arcy J.M. Cain" <darcy@druid.net>)
List pgsql-general
On Tue, 10 May 2016 09:50:10 -0400, "D'Arcy J.M. Cain"
<darcy@druid.net> wrote:

>On Mon, 09 May 2016 18:15:16 -0400
>Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> > I did think of that but how do I define that in pg_hba?  The host
>> > field only specifies the remote IP, not the local one.
>>
>> Right, but you'd be using it essentially as a loopback interface.
>> Say you set it up as 192.168.0.42 --- you'd tell PHP to connect to
>> Postgres on 192.168.0.42, and Postgres would also see the PHP
>> connections as coming in from 192.168.0.42.
>
>Can you expand on this?  I can't seem to get my head around it.  How
>does the client make it look like it is coming from this ersatz
>loopback IP?  In fact, I don't even need to add this to pg_hba since
>anything outside of my trusted IPs requires a password

On Linux (or Unix) you'd set up a forwarding record in iptables that
redirects a second port to Postgresql.

http://www.cyberciti.biz/faq/linux-port-redirection-with-iptables/

I don't know offhand a way to do that on Windows, but I presume that
it is possible.

George

pgsql-general by date:

Previous
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: Using both ident and password in pg_hba.conf
Next
From: "D'Arcy J.M. Cain"
Date:
Subject: Re: Using both ident and password in pg_hba.conf