Re: Authorise root as postgres

From: * Tong * <tong(at)none(dot)hub(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Authorise root as postgres
Date: 2002-11-19 01:29:48
Message-ID: 3DD9940C.1020305@none
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Thank you for the reply.

Bruno Wolff III wrote:
>>How can I authorise root the same previliage as postgres?
>>
>>My postgres is password protected, I want to use 'psql -U postgres' as a
>>root without specifying password every time, or for a certain group of
>
> If you are using postgres through a socket (and hence must be on the
> same machine as the server), running at least postgresql 7.2 and your
> OS supports getpeerid, then you can use ident authentication and
> permit root to connect as the postgres user without using a password.

All the anwsers should be yes, except that I don't know about getpeerid.
I'm using RH8, BTW.

Here is what I've been trying (postgresql 7.2 that comes along with RH8):

In $PGDATA/pg_hba.conf, add:

# TYPE DATABASE IP_ADDRESS MASK AUTH_T AUTH_ARG
local template1 ident

printf 'admins\troot\tpostgres\n' >> $PGDATA/pg_ident.conf
killall -HUP postmaster

It will still ask for password when 'psql template1' as root. Besides,
specifying either root password or postgres password won't work.

What is supposed to be the right way?

PS. the following works. So I guess it is not the problem of ident:

# TYPE DATABASE IP_ADDRESS MASK AUTH_T AUTH_ARG
local sameuser ident sameuser

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Daniel S. Myers 2002-11-19 01:49:28 Query optimization question
Previous Message Lee Harr 2002-11-19 01:22:24 Re: Bug with sequence