Обсуждение: pg_hba.conf question

Поиск
Список
Период
Сортировка

pg_hba.conf question

От
"Graham Vickrage"
Дата:
I am trying to run an insert script via a contrab job on linux. I am having
problems figuring out the security. What I need is for the local setting to
allow a connection as the same unix user I am logged in as i.e. postgres.

I noticed that you can't use the 'ident sameuser' with local unix sockets,
what is the method of getting round this as I cant use trust for this
database?

Thanks

Graham


Вложения

Re: pg_hba.conf question

От
Tom Lane
Дата:
"Graham Vickrage" <graham@digitalplanit.com> writes:
> I noticed that you can't use the 'ident sameuser' with local unix sockets,
> what is the method of getting round this as I cant use trust for this
> database?

ident only works with TCP sockets.  You could require people to connect
to host localhost, ie, use a local TCP connection instead of a Unix
socket.  Set up 127.0.0.1 as ident sameuser and socket connections as
reject in pg_hba.conf.

            regards, tom lane

RE: pg_hba.conf question

От
"Graham Vickrage"
Дата:
I have tried entering the following as suggested: -
local        all                                               reject
host         all         127.0.0.1           255.255.255.0       ident
sameuser

I have also tried
local        all                                               reject
host         all         127.0.0.1           255.255.255.0     trust

After trying the usual command %psql dbname to connect I keep getting the
message
No pg_hba.conf entry for host localhost, user postgres, database dbname

Is there something obvious I am missing????

Thanks

Graham

-----Original Message-----
From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
Sent: 29 January 2001 15:08
To: Graham Vickrage
Cc: Postgres Admin
Subject: Re: [ADMIN] pg_hba.conf question


"Graham Vickrage" <graham@digitalplanit.com> writes:
> I noticed that you can't use the 'ident sameuser' with local unix sockets,
> what is the method of getting round this as I cant use trust for this
> database?

ident only works with TCP sockets.  You could require people to connect
to host localhost, ie, use a local TCP connection instead of a Unix
socket.  Set up 127.0.0.1 as ident sameuser and socket connections as
reject in pg_hba.conf.

            regards, tom lane


Re: pg_hba.conf question

От
Tom Lane
Дата:
"Graham Vickrage" <graham@digitalplanit.com> writes:
> After trying the usual command %psql dbname to connect I keep getting the
> message
> No pg_hba.conf entry for host localhost, user postgres, database dbname

Looks to me like you're trying to connect via Unix-socket.  Try
specifying PGHOST=localhost at the client.

            regards, tom lane

Re: pg_hba.conf question

От
Milind Patil
Дата:

On Mon, 29 Jan 2001, Tom Lane wrote:

> "Graham Vickrage" <graham@digitalplanit.com> writes:
> > After trying the usual command %psql dbname to connect I keep getting the
> > message
> > No pg_hba.conf entry for host localhost, user postgres, database dbname
>
> Looks to me like you're trying to connect via Unix-socket.  Try
> specifying PGHOST=localhost at the client.
>
>             regards, tom lane
>
>

Well , it seems Ur editing wrong file.

If Ur working on postgres 6.5 edit the file pg_hba.conf file in pgsql dir

however if Ur working on postgres 7 edit file pg_hba.conf file in
pgsq/data dir and locate other pg_hba.conf file if exists and rename them.

Check this out.

Regrds,

Milind.