From: Amn Ojee Uw <amnojeeuw@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Peer authentication failed ???
Date: Wed, 4 Oct 2023 05:28:17 -0400
Message-ID: <1df2db82-132d-9225-5bc6-07d67f359c05@gmail.com> (raw)
In-Reply-To: <20231003133736.zqxkqrbnmp44kpwg@hjp.at>
References: <8cac9e3b-f03b-2a6f-f787-958b83775321@gmail.com>
<20231003133736.zqxkqrbnmp44kpwg@hjp.at>
Yes!
Thanks so much it worked!
On 10/3/23 9:37 a.m., Peter J. Holzer wrote:
> On 2023-10-03 05:55:51 -0400, Amn Ojee Uw wrote:
>> psql -U my_group_worker -d my_group_db
>>
>> psql: error: connection to server on socket "/var/run/postgresql/.s.PGSQL.5432"
>> failed: FATAL: Peer authentication failed for user "my_group_worker"
>>
>> *** What am I doing wrong?
> PostgreSQL uses the first matching rule from pg_hba.conf. Presumably
> (because that's the default on Debian/Ubuntu) you have it set up to use
> peer authentication on the unix socket and password authentication
> (scram or md5) on everything else.
>
> You are connecting via the Unix socket (/var/run/postgresql/.s.PGSQL.5432),
> so the server will attempt peer authentication and nothing else. To get
> it to attempt password authentication connect via a tcp socket:
>
> psql -U my_group_worker -h localhost -d my_group_db
>
> (More conveniently set up ident authentication for your users, then you
> don't need a password.)
>
> hp
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: amnojeeuw@gmail.com
Subject: Re: Peer authentication failed ???
In-Reply-To: <1df2db82-132d-9225-5bc6-07d67f359c05@gmail.com>
References: <8cac9e3b-f03b-2a6f-f787-958b83775321@gmail.com> <20231003133736.zqxkqrbnmp44kpwg@hjp.at> <1df2db82-132d-9225-5bc6-07d67f359c05@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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