Changing the admin/postgres user password

From: Jeffrey Walton <noloader(at)gmail(dot)com>
To: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Changing the admin/postgres user password
Date: 2022-09-06 02:40:02
Message-ID: CAH8yC8mXpDRAwn4b4k1wkCqU7WEJJDWv0=DvCVXgM4-nckzBDA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Everyone,

I'm struggling to set the admin/postgres user password and use it on
Fedora 36. This is a fresh install on a new VM. The admin's name is
postgres. We created the user, and used the passwd utility to set the
Linux password 'hi...HS'. The ellipses are over 28 characters, so it
is a 32-character password.

Next, move onto Postgres auth. I followed
https://www.postgresql.org/docs/current/install-short.html . We used
'su - postgres' and logged on with Linux password. I changed the
postgres password with 'alter user postgres with password hi...HS'.
The change appeared to be successful.

Next, restart the service:

sudo systemctl restart postgresql.service

And finally, try the new password:

PGPASSWORD=hi...HS psql -U postgres
psql: error: connection to server on socket
"/var/run/postgresql/.s.PGSQL.5432" failed:
FATAL: Peer authentication failed for user "postgres"

It appears the password is not working. I screwed something up somewhere. Ugh...

Does anyone know what I did wrong in this process?

Or maybe better, what part of the manual discusses auth failures so I
can read about them?

Thanks in advance.

Jeff

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Christophe Pettus 2022-09-06 02:46:49 Re: Changing the admin/postgres user password
Previous Message Maxim Boguk 2022-09-05 23:28:57 Re: Missing query plan for auto_explain.