pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
fallback authentication
7+ messages / 3 participants
[nested] [flat]

* fallback authentication
@ 2004-12-10 20:20 Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-11 01:50 ` Re: fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  0 siblings, 1 reply; 7+ messages in thread

From: Ron Peterson @ 2004-12-10 20:20 UTC (permalink / raw)
  To: pgsql-admin

I've configured PostgreSQL (8.0.0beta5) to do ldap authenticatation via
pam for connections to localhost.  My hba.conf looks like:

host    all         all         127.0.0.1         255.255.255.255   pam

My pam.d/postgresql file looks like:

auth     required     pam_ldap.so
account  required     pam_ldap.so

This all works great.

Sometimes, however, I would like to create an account in PostgreSQL
which I do not want to also maintain in LDAP.  Is it possible to
configure authentication to fall through to a different method?

-- 
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso



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

* Re: fallback authentication
  2004-12-10 20:20 fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
@ 2004-12-11 01:50 ` Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-11 19:51   ` Re: fallback authentication Bruno Wolff III <bruno@wolff.to>
  0 siblings, 1 reply; 7+ messages in thread

From: Ron Peterson @ 2004-12-11 01:50 UTC (permalink / raw)
  To: pgsql-admin

On Fri, Dec 10, 2004 at 03:20:50PM -0500, Ron Peterson wrote:

> Sometimes, however, I would like to create an account in PostgreSQL
> which I do not want to also maintain in LDAP.  Is it possible to
> configure authentication to fall through to a different method?

I suppose the right thing to do is either

* don't be lazy, and update my LDAP maintainance to include the
  required accounts, or

* fall through in pam.  Is there anything similar in concept to
  libpam-pgsql, but which simply authenticates against PostgreSQL's
  built-in authentication mechanism?

-- 
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso



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

* Re: fallback authentication
  2004-12-10 20:20 fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-11 01:50 ` Re: fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
@ 2004-12-11 19:51   ` Bruno Wolff III <bruno@wolff.to>
  2004-12-12 03:55     ` Re: fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  0 siblings, 1 reply; 7+ messages in thread

From: Bruno Wolff III @ 2004-12-11 19:51 UTC (permalink / raw)
  To: Ron Peterson <rpeterso@mtholyoke.edu>; +Cc: pgsql-admin

On Fri, Dec 10, 2004 at 20:50:56 -0500,
  Ron Peterson <rpeterso@mtholyoke.edu> wrote:
> On Fri, Dec 10, 2004 at 03:20:50PM -0500, Ron Peterson wrote:
> 
> > Sometimes, however, I would like to create an account in PostgreSQL
> > which I do not want to also maintain in LDAP.  Is it possible to
> > configure authentication to fall through to a different method?
> 
> I suppose the right thing to do is either
> 
> * don't be lazy, and update my LDAP maintainance to include the
>   required accounts, or
> 
> * fall through in pam.  Is there anything similar in concept to
>   libpam-pgsql, but which simply authenticates against PostgreSQL's
>   built-in authentication mechanism?

You can put per user exceptions first in your pg_hba.conf file. That way
these people will be handled by those rules, but other users can be
authenticated using pam.



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

* Re: fallback authentication
  2004-12-10 20:20 fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-11 01:50 ` Re: fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-11 19:51   ` Re: fallback authentication Bruno Wolff III <bruno@wolff.to>
@ 2004-12-12 03:55     ` Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-12 05:43       ` Re: fallback authentication Bruno Wolff III <bruno@wolff.to>
  2004-12-12 18:11       ` Re: fallback authentication Dmitry Morozovsky <marck@rinet.ru>
  0 siblings, 2 replies; 7+ messages in thread

From: Ron Peterson @ 2004-12-12 03:55 UTC (permalink / raw)
  To: pgsql-admin

On Sat, Dec 11, 2004 at 01:51:07PM -0600, Bruno Wolff III wrote:
> On Fri, Dec 10, 2004 at 20:50:56 -0500,
>   Ron Peterson <rpeterso@mtholyoke.edu> wrote:
> > On Fri, Dec 10, 2004 at 03:20:50PM -0500, Ron Peterson wrote:
> > 
> > > Sometimes, however, I would like to create an account in PostgreSQL
> > > which I do not want to also maintain in LDAP.  Is it possible to
> > > configure authentication to fall through to a different method?
> > 
> > I suppose the right thing to do is either
> > 
> > * don't be lazy, and update my LDAP maintainance to include the
> >   required accounts, or
> > 
> > * fall through in pam.  Is there anything similar in concept to
> >   libpam-pgsql, but which simply authenticates against PostgreSQL's
> >   built-in authentication mechanism?
> 
> You can put per user exceptions first in your pg_hba.conf file. That way
> these people will be handled by those rules, but other users can be
> authenticated using pam.

I have:

host    all         all         127.0.0.1         255.255.255.255   md5
host    all         all         127.0.0.1         255.255.255.255   pam postgresql
host    all         all         0.0.0.0           0.0.0.0           reject

I've also tried reversing the first two lines.  Either strategy
individually works, but I'd like lookups which don't work locally to try
pam (or vice-versa).  What am I missing?

I have to use pam to authenticate my local userbase, unless I start also
maintaining the necessary postgresql password hash.  But I'd like to
also have a few local administrative accounts that don't exist in ldap.
Bottom line is, I can always put them in ldap if I really have to; I was
just hoping there was a lazier way.  I feel like I'm working harder at
being lazy than if I'd just tweak my ldap account maintainance
procedures, though... ;)

-- 
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso



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

* Re: fallback authentication
  2004-12-10 20:20 fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-11 01:50 ` Re: fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-11 19:51   ` Re: fallback authentication Bruno Wolff III <bruno@wolff.to>
  2004-12-12 03:55     ` Re: fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
@ 2004-12-12 05:43       ` Bruno Wolff III <bruno@wolff.to>
  2004-12-13 03:36         ` Re: fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  1 sibling, 1 reply; 7+ messages in thread

From: Bruno Wolff III @ 2004-12-12 05:43 UTC (permalink / raw)
  To: Ron Peterson <rpeterso@mtholyoke.edu>; +Cc: pgsql-admin

On Sat, Dec 11, 2004 at 22:55:55 -0500,
  Ron Peterson <rpeterso@mtholyoke.edu> wrote:
> 
> I have:
> 
> host    all         all         127.0.0.1         255.255.255.255   md5
> host    all         all         127.0.0.1         255.255.255.255   pam postgresql
> host    all         all         0.0.0.0           0.0.0.0           reject
> 
> I've also tried reversing the first two lines.  Either strategy
> individually works, but I'd like lookups which don't work locally to try
> pam (or vice-versa).  What am I missing?

You can't use 'all' for the username specification. You need to explicitly
list out the usernames in the first host line. (Which should be the md5
line.)



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

* Re: fallback authentication
  2004-12-10 20:20 fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-11 01:50 ` Re: fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-11 19:51   ` Re: fallback authentication Bruno Wolff III <bruno@wolff.to>
  2004-12-12 03:55     ` Re: fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-12 05:43       ` Re: fallback authentication Bruno Wolff III <bruno@wolff.to>
@ 2004-12-13 03:36         ` Ron Peterson <rpeterso@mtholyoke.edu>
  0 siblings, 0 replies; 7+ messages in thread

From: Ron Peterson @ 2004-12-13 03:36 UTC (permalink / raw)
  To: pgsql-admin

On Sat, Dec 11, 2004 at 11:43:08PM -0600, Bruno Wolff III wrote:
> On Sat, Dec 11, 2004 at 22:55:55 -0500,
>   Ron Peterson <rpeterso@mtholyoke.edu> wrote:
> > 
> > I have:
> > 
> > host    all         all         127.0.0.1         255.255.255.255   md5
> > host    all         all         127.0.0.1         255.255.255.255   pam postgresql
> > host    all         all         0.0.0.0           0.0.0.0           reject
> > 
> > I've also tried reversing the first two lines.  Either strategy
> > individually works, but I'd like lookups which don't work locally to try
> > pam (or vice-versa).  What am I missing?
> 
> You can't use 'all' for the username specification. You need to explicitly
> list out the usernames in the first host line. (Which should be the md5
> line.)

Thanks.  Exactly what I was hoping for.

-- 
Ron Peterson
Network & Systems Manager
Mount Holyoke College
http://www.mtholyoke.edu/~rpeterso



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

* Re: fallback authentication
  2004-12-10 20:20 fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-11 01:50 ` Re: fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
  2004-12-11 19:51   ` Re: fallback authentication Bruno Wolff III <bruno@wolff.to>
  2004-12-12 03:55     ` Re: fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
@ 2004-12-12 18:11       ` Dmitry Morozovsky <marck@rinet.ru>
  1 sibling, 0 replies; 7+ messages in thread

From: Dmitry Morozovsky @ 2004-12-12 18:11 UTC (permalink / raw)
  To: Ron Peterson <rpeterso@mtholyoke.edu>; +Cc: pgsql-admin

On Sat, 11 Dec 2004, Ron Peterson wrote:

RP> I have:
RP> 
RP> host    all         all         127.0.0.1         255.255.255.255   md5
RP> host    all         all         127.0.0.1         255.255.255.255   pam postgresql
RP> host    all         all         0.0.0.0           0.0.0.0           reject

This scheme would not work. However, something like the following may help:

local   all             pgsql   ident   sameuser

host    all		dba	127.0.0.1	255.255.255.255		md5
host    all		local	127.0.0.1	255.255.255.255		pam  postgresql

So you can do local maintenance like cron backups from pgsql account, and 
fallback login for dba user when pam or authenticating modules are not 
available.


Sincerely,
D.Marck                                     [DM5020, MCK-RIPE, DM3-RIPN]
------------------------------------------------------------------------
*** Dmitry Morozovsky --- D.Marck --- Wild Woozle --- marck@rinet.ru ***
------------------------------------------------------------------------



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


end of thread, other threads:[~2004-12-13 03:36 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-12-10 20:20 fallback authentication Ron Peterson <rpeterso@mtholyoke.edu>
2004-12-11 01:50 ` Ron Peterson <rpeterso@mtholyoke.edu>
2004-12-11 19:51   ` Bruno Wolff III <bruno@wolff.to>
2004-12-12 03:55     ` Ron Peterson <rpeterso@mtholyoke.edu>
2004-12-12 05:43       ` Bruno Wolff III <bruno@wolff.to>
2004-12-13 03:36         ` Ron Peterson <rpeterso@mtholyoke.edu>
2004-12-12 18:11       ` Dmitry Morozovsky <marck@rinet.ru>

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