Symptoms
-
Attempts to access PostgreSQL database hosted on the Plesk server using network connection to
localhost:5432
fail with the following error:psql: FATAL: Ident authentication failed for user “jdoe”
-
Websites using Ruby applications which access PostgreSQL database show the following error:
500 external Server Error
If you are the administrator of this website, then please read this web application’s log file and/or the web server’s log file to find out what went wrong.
Cause
PostgreSQL is configured to use ident authentication for network connections.
Resolution
-
Connect to the server via SSH
-
Change authentication configuration of host type from ident to md5 in
pg_hba.conf
file. By default it is located for example at the following paths:-
/var/lib/pgsql/data/pg_hba.conf
on RedHat-based systems -
/var/lib/postgresql/9.1/main/pg_hba.conf
on Debian-based systems
Update the following lines:
host all all 127.0.0.1/32 ident
host all all ::1/128 ident
host all all 203.0.113.2/32 identTo the following:
host all all 127.0.0.1/32 md5
host all all ::1/128 md5
host all all 203.0.113.2/32 md5 -
-
Restart PostgreSQL service to apply changes:
# service postgresql restart