Re: Enable user access from remote host

From: John R Pierce <pierce(at)hogranch(dot)com>
To: Piotre Ugrumov <afmulone(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Enable user access from remote host
Date: 2009-03-08 19:29:07
Message-ID: 49B41C83.5060606@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Piotre Ugrumov wrote:
> Hi,
> I inserted this line at the end of the pg_hba.conf
>
> host test angelo "" ident sameuser
>
> I inserted the "" to allow to everyone to access to the db.
> But if I try to access, from another host, I receive an error. What is
> the error in that line?
>

host test angelo 0.0.0.0/0 ident sameuser

if you want to allow angelo to connect to database test from any IP...
*HOWEVER* "ident sameuser" should *not* be used for HOST connections,
its only reliable for LOCAL connections. instead, assign angelo a
password...

alter user angelo with encrypted password 'somepassword';

and in pg_hba.conf, specify...

host test angelo 0.0.0.0/0 md5

note, also, if there are any pg_hba.conf records in FRONT of this one
which would match on the connection, they will be used INSTEAD... for
instance...

host all all 192.168.1.0/24 md5

that allows any user, any database on the subnet 192.168.1.0/24 to
connect with md5 password authentication, and any following records
would be ignored.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-03-08 20:15:37 Re: Newbie questions relating to transactions
Previous Message Scott Marlowe 2009-03-08 19:15:28 Re: Performance of subselects