pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Multiple auth types for a connection
3+ messages / 3 participants
[nested] [flat]

* Multiple auth types for a connection
@ 2007-05-02 20:22 Rob Cherry <postgresadmin@lxrb.com>
  2007-05-02 21:42 ` Re: Multiple auth types for a connection Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 3+ messages in thread

From: Rob Cherry @ 2007-05-02 20:22 UTC (permalink / raw)
  To: pgsql-admin

Hi,

I am operating in an environment where we have regular users who will
authenticate via PAM and software users for automated processes that
would be more appropriate to authenticate via a password (encrypted or
not - irrelevant to this question).  I have taken a look through the
documentation and google and done some trial and error, but I dont seem
to be able to get this working for a single client to be able to use
either method.

My 2 guesses involved changing the $PGDATA$/pg_hba.conf to try these
options:

1:
host    all         all         0.0.0.0/0             pam,password

(also tried space seperated as well as comma seperated)

2:
host    all         all         0.0.0.0/0             pam
host    all         all         0.0.0.0/0             password

In both cases (neither caused an error) the first type wins and the
other gives access denied.

Does anyone know if it is possible to overload auth types like this such
that if pam fails password would be tried?

Many thanks in advance,

Rob Cherry








^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Multiple auth types for a connection
  2007-05-02 20:22 Multiple auth types for a connection Rob Cherry <postgresadmin@lxrb.com>
@ 2007-05-02 21:42 ` Tom Lane <tgl@sss.pgh.pa.us>
  2007-05-02 22:13   ` Re: Multiple auth types for a connection Geoff Tolley <geoff@polimetrix.com>
  0 siblings, 1 reply; 3+ messages in thread

From: Tom Lane @ 2007-05-02 21:42 UTC (permalink / raw)
  To: Rob Cherry <postgresadmin@lxrb.com>; +Cc: pgsql-admin

Rob Cherry <postgresadmin@lxrb.com> writes:
> Does anyone know if it is possible to overload auth types like this such
> that if pam fails password would be tried?

No, it's not, as per the Fine Manual:

: The first record with a matching connection type, client address,
: requested database, and user name is used to perform
: authentication. There is no "fall-through" or "backup": if one record is
: chosen and the authentication fails, subsequent records are not
: considered.  If no record matches, access is denied.

Your best bet is probably to list the automated users specifically in
a record that specifies password, and then put another record that
selects pam for everyone else.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Multiple auth types for a connection
  2007-05-02 20:22 Multiple auth types for a connection Rob Cherry <postgresadmin@lxrb.com>
  2007-05-02 21:42 ` Re: Multiple auth types for a connection Tom Lane <tgl@sss.pgh.pa.us>
@ 2007-05-02 22:13   ` Geoff Tolley <geoff@polimetrix.com>
  0 siblings, 0 replies; 3+ messages in thread

From: Geoff Tolley @ 2007-05-02 22:13 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Rob Cherry <postgresadmin@lxrb.com>; pgsql-admin

Tom Lane wrote:
> Rob Cherry <postgresadmin@lxrb.com> writes:
>> Does anyone know if it is possible to overload auth types like this such
>> that if pam fails password would be tried?
> 
> No, it's not, as per the Fine Manual:

Provided that you don't care about the security and performance 
implications of SSL vs non-SSL connectivity, wouldn't it be possible to 
have something like:

hostnossl    all         all         0.0.0.0/0             krb5
hostssl      all         all         0.0.0.0/0             md5

... and then have sslmode set to prefer or allow on the client side?

Cheers,
Geoff



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2007-05-02 22:13 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2007-05-02 20:22 Multiple auth types for a connection Rob Cherry <postgresadmin@lxrb.com>
2007-05-02 21:42 ` Tom Lane <tgl@sss.pgh.pa.us>
2007-05-02 22:13   ` Geoff Tolley <geoff@polimetrix.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox