Sharing /etc/passwd with PostgreSQL

Lists: pgsql-admin
From: Eamonn Martin <mas01em(at)gold(dot)ac(dot)uk>
To: pgsql-admin(at)postgresql(dot)org
Subject: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-07 14:08:37
Message-ID: Pine.GSO.4.64.0908071459430.1310@scorpio.gold.ac.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin


Hi,

Could someone confirm that the ability to share the Linux system
/etc/passwd (or shadow) file with PostgreSQL is definitely defunct?

I've searched the archives and, as far as I can tell, this functionality
was removed after version 7.2 as "few were using it". Well we were using
it and we have thus been stuck with using version 7.2 ever since. We'd
really like to finally upgrade to version 8 but would rather not create
separate passwords for everyone unless we really have no choice. Is this
definitely the case?

Thanks,
Ed


From: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
To: Eamonn Martin <mas01em(at)gold(dot)ac(dot)uk>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-08 00:24:13
Message-ID: dcc563d10908071724q416e88f7x281798c8d760c5db@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On Fri, Aug 7, 2009 at 8:08 AM, Eamonn Martin<mas01em(at)gold(dot)ac(dot)uk> wrote:
>
> Hi,
>
> Could someone confirm that the ability to share the Linux system /etc/passwd
> (or shadow) file with PostgreSQL is definitely defunct?
>
> I've searched the archives and, as far as I can tell, this functionality was
> removed after version 7.2 as "few were using it".  Well we were using it and
> we have thus been stuck with using version 7.2 ever since.  We'd really like
> to finally upgrade to version 8 but would rather not create separate
> passwords for everyone unless we really have no choice.  Is this definitely
> the case?

Yep, it's definitely the case. You could look into using LDAP for
authentication of both your users on regular unix type accounts and
pgsql users.


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Eamonn Martin <mas01em(at)gold(dot)ac(dot)uk>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-08 00:27:43
Message-ID: 20090808002743.GL5290@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Eamonn Martin wrote:
>
> Hi,
>
> Could someone confirm that the ability to share the Linux system
> /etc/passwd (or shadow) file with PostgreSQL is definitely defunct?
>
> I've searched the archives and, as far as I can tell, this
> functionality was removed after version 7.2 as "few were using it".
> Well we were using it and we have thus been stuck with using version
> 7.2 ever since. We'd really like to finally upgrade to version 8
> but would rather not create separate passwords for everyone unless
> we really have no choice. Is this definitely the case?

You can authenticate users with PAM, which amounts more or less to the
same thing.

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Eamonn Martin <mas01em(at)gold(dot)ac(dot)uk>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-08 00:40:25
Message-ID: 4101.1249692025@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> You can authenticate users with PAM, which amounts more or less to the
> same thing.

I believe though that using PAM against /etc/shadow would require the
postmaster to run as root. You need some external authentication
server; PAM by itself isn't going to solve it. Maybe LDAP or Kerberos?

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Eamonn Martin <mas01em(at)gold(dot)ac(dot)uk>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-08 00:57:31
Message-ID: 20090808005731.GM5290@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> > You can authenticate users with PAM, which amounts more or less to the
> > same thing.
>
> I believe though that using PAM against /etc/shadow would require the
> postmaster to run as root. You need some external authentication
> server; PAM by itself isn't going to solve it. Maybe LDAP or Kerberos?

At least my system seems to provide a setgid helper program that's
supposed to read /etc/shadow, to work around this problem.

BTW I notice that this does not work unless the client supplies the
password the first time around; psql does not retry. It only works if I
do "psql -W".

--
Alvaro Herrera http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Eamonn Martin <mas01em(at)gold(dot)ac(dot)uk>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-08 01:07:29
Message-ID: 4536.1249693649@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> BTW I notice that this does not work unless the client supplies the
> password the first time around; psql does not retry. It only works if I
> do "psql -W".

Huh, that sounds like a bug someplace. Care to trace through it?

regards, tom lane


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Eamonn Martin <mas01em(at)gold(dot)ac(dot)uk>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-20 15:34:27
Message-ID: 20090820153427.GG6261@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> > BTW I notice that this does not work unless the client supplies the
> > password the first time around; psql does not retry. It only works if I
> > do "psql -W".
>
> Huh, that sounds like a bug someplace. Care to trace through it?

It had to do with me having a bogus password in .pgpass (so psql was
first trying empty password, then the one in .pgpass, and both failing).
Pilot error. However, I'd say that we ought to give a notice if the
password in .pgpass fails.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
Cc: Eamonn Martin <mas01em(at)gold(dot)ac(dot)uk>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-20 15:37:42
Message-ID: 14921.1250782662@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> It had to do with me having a bogus password in .pgpass (so psql was
> first trying empty password, then the one in .pgpass, and both failing).
> Pilot error. However, I'd say that we ought to give a notice if the
> password in .pgpass fails.

Can we do something like
ERROR: password authentication failed (using password from .pgpass)
ie, just tack on a comment to the error message?

regards, tom lane


From: "Tena Sakai" <tsakai(at)gallo(dot)ucsf(dot)edu>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>
Cc: "Eamonn Martin" <mas01em(at)gold(dot)ac(dot)uk>, <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-20 17:31:58
Message-ID: FE44E0D7EAD2ED4BB2165071DB8E328C04E84CB0@egcrc-ex01.egcrc.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Hi Everybody,

I am interested in following this particular thread,
though, yesterday our mail server went down for a few
hours and I don't have the whole account.

Can somebody please tell me how I could retrieve a
history of this particular thread?

Thank you in advance

Regards,

Tena Sakai
tsakai(at)gallo(dot)ucsf(dot)edu

-----Original Message-----
From: pgsql-admin-owner(at)postgresql(dot)org on behalf of Tom Lane
Sent: Thu 8/20/2009 8:37 AM
To: Alvaro Herrera
Cc: Eamonn Martin; pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] Sharing /etc/passwd with PostgreSQL

Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> It had to do with me having a bogus password in .pgpass (so psql was
> first trying empty password, then the one in .pgpass, and both failing).
> Pilot error. However, I'd say that we ought to give a notice if the
> password in .pgpass fails.

Can we do something like
ERROR: password authentication failed (using password from .pgpass)
ie, just tack on a comment to the error message?

regards, tom lane


From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Tena Sakai <tsakai(at)gallo(dot)ucsf(dot)edu>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Eamonn Martin <mas01em(at)gold(dot)ac(dot)uk>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-20 17:58:26
Message-ID: 1250791106.26768.32.camel@jd-desktop.unknown.charter.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On Thu, 2009-08-20 at 10:31 -0700, Tena Sakai wrote:
> Hi Everybody,
>
> I am interested in following this particular thread,
> though, yesterday our mail server went down for a few
> hours and I don't have the whole account.
>
> Can somebody please tell me how I could retrieve a
> history of this particular thread?
>
> Thank you in advance

http://archives.postgresql.org/

Joshua D. Drake

--
PostgreSQL.org Major Contributor
Command Prompt, Inc: http://www.commandprompt.com/ - 503.667.4564
Consulting, Training, Support, Custom Development, Engineering


From: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
To: Tena Sakai <tsakai(at)gallo(dot)ucsf(dot)edu>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-20 17:58:52
Message-ID: 396486430908201058l59ca52f1j936d6f226cc190c0@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

On Thu, Aug 20, 2009 at 10:31 AM, Tena Sakai<tsakai(at)gallo(dot)ucsf(dot)edu> wrote:

> Can somebody please tell me how I could retrieve a
> history of this particular thread?

Generally:

http://archives.postgresql.org/

Specifically:

http://archives.postgresql.org/pgsql-admin/2009-08/msg00056.php

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug


From: "Tena Sakai" <tsakai(at)gallo(dot)ucsf(dot)edu>
To: "Richard Broersma" <richard(dot)broersma(at)gmail(dot)com>, <jd(at)commandprompt(dot)com>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2009-08-20 20:22:03
Message-ID: FE44E0D7EAD2ED4BB2165071DB8E328C04E84CB1@egcrc-ex01.egcrc.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Many thanks!

Tena Sakai

-----Original Message-----
From: Richard Broersma [mailto:richard(dot)broersma(at)gmail(dot)com]
Sent: Thu 8/20/2009 10:58 AM
To: Tena Sakai
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: [ADMIN] Sharing /etc/passwd with PostgreSQL

On Thu, Aug 20, 2009 at 10:31 AM, Tena Sakai<tsakai(at)gallo(dot)ucsf(dot)edu> wrote:

> Can somebody please tell me how I could retrieve a
> history of this particular thread?

Generally:

http://archives.postgresql.org/

Specifically:

http://archives.postgresql.org/pgsql-admin/2009-08/msg00056.php

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug


From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Eamonn Martin <mas01em(at)gold(dot)ac(dot)uk>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Sharing /etc/passwd with PostgreSQL
Date: 2010-02-23 21:06:58
Message-ID: 201002232106.o1NL6wj25007@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-admin

Tom Lane wrote:
> Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> > It had to do with me having a bogus password in .pgpass (so psql was
> > first trying empty password, then the one in .pgpass, and both failing).
> > Pilot error. However, I'd say that we ought to give a notice if the
> > password in .pgpass fails.
>
> Can we do something like
> ERROR: password authentication failed (using password from .pgpass)
> ie, just tack on a comment to the error message?

I looked into that but found it difficult to implement because only
libpq knows about pgpass, while the message is printed by psql.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com
PG East: http://www.enterprisedb.com/community/nav-pg-east-2010.do
+ If your life is a hard drive, Christ can be your backup. +