Troubleshooting·PostgreSQL
PostgreSQL Password Authentication
A remote client with the right password is still refused - because no pg_hba rule covers it. The error names the host, the role and the database, and changing any one of the three changes the outcome.
Roles and Authentication Guide 17 of 47 Intermediate
- OSUbuntu 26.04 LTS (resolute)
- PostgreSQL18.6-0ubuntu0.26.04.1
- Authscram-sha-256
- TimeAbout 16 min
- Reviewed27 August 2026
Written against the versions above. scram-sha-256 is the default since PostgreSQL 14 and is what `CREATE ROLE ... PASSWORD` stores. The older md5 method is still accepted in pg_hba.conf and should not be used for anything new.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| db-a01 | 192.168.0.81 | Ubuntu 26.04 LTS | Primary / Source / Replica Set Member 1 | 2 Core | 4 GB | 50 GB |
| db-util01 | 192.168.0.84 | Ubuntu 26.04 LTS | Client, Backup Target and Monitoring | 2 Core | 4 GB | 50 GB |
Before you start
listen_addressesset to accept network connections.- A second host with
postgresql-clientinstalled.
-
Confirm the server is reachable at all
-
Connect with the correct password, and be refused
-
Add exactly the rule that was missing
-
Change the password, and then the database