Re: Root acces to databases without being prompted for password

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Rafael Barrera Oro" <borafael(at)gmail(dot)com>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Root acces to databases without being prompted for password
Date: 2010-09-17 16:19:04
Message-ID: 4C934EA80200002500035957@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Rafael Barrera Oro <borafael(at)gmail(dot)com> wrote:

> I've "inherited" a pgsql database (in linux server, already
> configured and set up) and i noticed that the root user can access
> a particular database without being prompted for password (using
> the psql command).
>
> I assume it's something related to database ownership and user
> permissions but i can't find exactly what is causing this.
>
> I'd like to replicate this behaviour for other database since my
> goal is to use the root user for executing cron task (where a
> password prompts is highly annoying)

That's probably because of the configuration in the pg_hba.conf
file:

http://www.postgresql.org/docs/current/interactive/auth-pg-hba-conf.html

or maybe the .pgpass file:

http://www.postgresql.org/docs/current/interactive/libpq-pgpass.html

By the way, I would seriously consider setting this for a "database
superuser" login related to an OS login which owns the database,
rather than the root account. Using root anytime it's not
absolutely necessary is generally not good practice.

-Kevin

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message badair 2010-09-17 17:39:36 Ingres statdump equivalent for postgresql
Previous Message Rafael Barrera Oro 2010-09-17 16:11:10 Root acces to databases without being prompted for password