0

When i restart the postgresql server with sudo service postgresql restart everything works as expected.

But the logfile /var/log/postgresql/postgresql-9.3-main.log shows that a fatal error happened.

2016-12-09 11:50:26 CET LOG:  MultiXact member wraparound protections are now enabled
2016-12-09 11:50:26 CET LOG:  autovacuum launcher started
2016-12-09 11:50:26 CET LOG:  database system is ready to accept connections 
2016-12-09 11:50:26 CET FATAL:  password authentication failed for user "postgres"
2016-12-09 11:50:26 CET DETAIL:  Connection matched pg_hba.conf line xx: "local   all             postgres                                md5"
2016-12-09 11:50:27 CET FATAL:  password authentication failed for user "postgres"

I did setup the postgres superuser postgres with a secure password. I am able to login with

psql -U postgres

But the UNIX user postgres is also setup with a login shell and a password. So i locked this user by setting /usr/sbin/nologin in /etc/passwd. I am not able to su into the UNIX postgres user anymore but with

sudo -u postgres psql postgres

it is possible to log into the database.

Restarting the server still shows the same error message.

In pg_hba.conf the method for postgres and all is set to md5.

I dont really understand what the server is complaining about, because the connection can be established and i am able to login.

Many thanks in advance!

1 Answer 1

1

Either set in pg_hba.conf user "postgres" as "peer" authentication or add into postgres $HOME directory file .pgpass with content localhost:*:*:postgres:password. File must have mod 600.

Sign up to request clarification or add additional context in comments.

1 Comment

Excellent thanks. That removed the fatal error messages!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.