Re: Bypassing authentication

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: PostgreSQL List - Novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Bypassing authentication
Date: 2010-07-10 13:01:11
Message-ID: BLU0-SMTP323424AEB2056A9E4295BEACB60@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Andre Majorel wrote:
> Is there a way to have psql bypass authentication as joe if the
> system user running psql is postgres, the way su doesn't ask for
> password if you are root ?
>
> sudo -u postgres psql -l # psql doesn't ask for a password
> sudo -u postgres psql -u joe -l # psql asks for joe's password
>
> joe is just a PostgreSQL role with no system counterpart so the
> "local all all ident sameuser" catch-all in pg_hba.conf is of no
> help here.
>
> Thanks in advance.
>

In the home directory of user postgres create a .pgpass file

localhost:*:*:joe:joepswd

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Donn Washburn 2010-07-10 17:00:23 postgresql and pgadmin3
Previous Message Frank Bax 2010-07-10 12:56:00 Re: SQL from Linux command line