Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to set up django on a fresh Ubuntu VM. I'm following the tutorials along until I get to this:

psycopg2.OperationalError: FATAL: Ident authentication failed for user "postgres"

The Ubuntu user "postgres" has had its password set to 123456:

sudo su postgres -c passwd

Using pdadmin, I connect to the pg instance at localhost, go into Login Roles, right click on the user 'postgres' and set the password to 123456. I then click OK and exit pgadmin3.

But, even after doing all this,

psql -U postgres -W

rejects the password I have given it. Django also continues to give me the same error even though has been setup with the correct info.

Anyone have any ideas?

share|improve this question
up vote 9 down vote accepted

This article and its comments might help:

“FATAL: Ident authentication failed”, or how cool ideas get bad usage schemas

share|improve this answer
Thank you. My google-fu was failing me, apparently. – Amy Aug 25 '10 at 18:09
That is too good damn article. Thanks. – Gaston Sanchez Dec 27 '14 at 4:02

change IPv4 local connections to trust in pg_hba.conf.

# IPv4 local connections:
host    all         all          trust

i hope it helps you...

share|improve this answer
This is allow ALL local users connect without passwords to Postgres. This is bad idea – nk9 Oct 29 '12 at 6:44

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.