Re: Socket Connection Authentication

From: Naveed Shaikh <naveed(dot)shaikh(at)enterprisedb(dot)com>
To: basti <black(dot)fledermaus(at)arcor(dot)de>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Socket Connection Authentication
Date: 2015-07-09 06:44:39
Message-ID: CAC50kKighAD=NW6FdO2y5mcHJpkd6Ds_QFgAfzgCxVY722-3kw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

The peer authentication method works by obtaining the client's operating
system user name from the kernel and using it as the allowed database user name
(with optional user name mapping). This method is only supported on local
connections.

*Please check the below steps as an Example:*

*1>>* Create user edb_admin.
useradd edb_admin
*2>>* Create database user edb_admin or if already exist then make sure
that the password of database user and os level user must match.
createuser -sP edb_admin
*3>>* If os level user is not exist with same password then it will show
error like as follows:
[root(at)localhost pg_log]# /opt/PostgreSQL/9.3/bin/psql -U edb_admin -d edb
-p 5444
psql.bin: FATAL: Peer authentication failed for user edb_admin"
[root(at)localhost pg_log]#

Once you will create user with password then login to the os level
user nocp_admin
and try to connect by same command:
[edb_admin(at)localhost pg_log]$ /opt/PostgreSQL/9.3/bin/psql -U edb_admin -d
edb -p 5444
psql.bin (9.3.1.3)
Type "help" for help.
edb=> \q
[edb_admin(at)localhost pg_log]$

Hope this helps.

Thanks & Regards,
Naveed Shaikh

On Thu, Jul 9, 2015 at 12:02 PM, basti <black(dot)fledermaus(at)arcor(dot)de> wrote:

> Hello,
> I try to use PHP with Postgresq1 socket connection. All works fine with
> following entry in
>
> pg_hba.conf
>
> local database user trust
> or
> local database user peer map=someuser
>
>
> pg_ident.conf
>
> # MAPNAME SYSTEM-USERNAME PG-USERNAME
> someuser www-data db-user
>
> When I try
>
> local database user md5
>
> I get the error: "Peer authentication failed for user ..."
> Is it possible to authenticate a user with md5 via socket connection?
>
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Julien Rouhaud 2015-07-09 07:58:27 Re: Oracle to PostgreSQL Migration - Need Information
Previous Message John R Pierce 2015-07-09 06:43:27 Re: Socket Connection Authentication