Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 log into my DB and am getting this error...

root@---:~# psql -U user database
psql: FATAL:  Peer authentication failed for user "user"

What does this mean? I'm pretty sure I can fix it by putting peer into my pg_hba.conf but I'm not sure if I should so so...

share|improve this question
up vote 4 down vote accepted

It means that the system attempted peer authentication (…obtaining the client's operating system user name from the kernel and using it as the allowed database user name (with optional user name mapping). This method is only supported on local connections.), and it failed.

Is your pg_hba.conf configured for peer authentication for local connections?
If so you may need to change that to a more appropriate auth method such as md5 or trust(not recommended).
Refer to the Postgres Manual for more information.

share|improve this answer
is there a way to restart the database once you change the pg_hba.conf? Have changed everything but still not working – ovatsug25 Jan 18 '13 at 21:06
@ovatsug25 Indeed there is - …If you edit the file on an active system, you will need to signal the postmaster (using pg_ctl reload or kill -HUP) to make it re-read the file. -- If you're going to be adminning a Postgres system you should bookmark the manual (ideally for the version you're running). It's an excellent piece of documentation, and you will be referring to it often. – voretaq7 Jan 18 '13 at 23:11

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.