Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3443302
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T08:46:29+00:00 2026-05-18T08:46:29+00:00

I have a fresh ubuntu 10.10 install with all updates and postgresql 8.4 In

  • 0

I have a fresh ubuntu 10.10 install with all updates and postgresql 8.4
In order for postgresql to accept login+password connections i have configured it via:

sudo su postgres
psql
ALTER USER postgres WITH PASSWORD 'password';
CREATE DATABASE myapp;
\q
exit
sudo vi /etc/postgresql/8.4/main/pg_hba.conf
change "local all all indent" to "local all all trust"

But, surprisingly, this is not working! The command

psql -U postgres password

Evaluates with error:

psql: FATAL:  Ident authentication failed for user "postgres"

Any hints how i can make the psql -U to work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T08:46:29+00:00Added an answer on May 18, 2026 at 8:46 am

    It is probably a good idea to leave the “postgres” user with ident authentication. By default I believe Ubuntu uses the “postgres” user to perform upgrades, backups, etc, and that requires that it is able to login without a specified password.

    I recommend creating another user (probably with your own username) and giving it admin privileges as well. Then you can use that user with passwords on local connections.

    Here is what the relevant parts of my pg_hba.conf look like:

    # allow postgres user to use "ident" authentication on Unix sockets
    # (as per recent comments, omit "sameuser" if on postgres 8.4 or later)
    local   all   postgres                         ident sameuser
    # allow all other users to use "md5" authentication on Unix sockets
    local   all   all                              md5
    # for users connected via local IPv4 or IPv6 connections, always require md5
    host    all   all        127.0.0.1/32          md5
    host    all   all        ::1/128               md5
    

    Also note that psql -U postgres password will not do what you want. The password should never be specified on the commandline. That will try to login as user “postgres” to a database named “password”.

    You should use psql -U postgres myapp instead. Postgres will automatically prompt you for a password, if it is configured properly to require one.

    In case we want the password be filled-in automatically, place it in $HOME/.pgpass file

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a fresh install of Ubuntu Karmic, Ruby and Rails. I checkout out
I have a VPS running a fresh install of Ubuntu 10.04 LTS. I'm trying
I have my server configured like this (this is on a fresh install of
I have fresh Rails 2.2 install, thing is that everything work fine until I
I have just installed VMWare Server 2.0 on a fresh Fedora Core 8 install.
I created a virtualbox with a fresh install of ubuntu 9.10. I am trying
I have Fresh Install SSRS 2008 R2 on Win2k8 box ( on which i
I have a fresh install of CakePHP 1.3.4 Stable. I created a very simple
I have a fresh CakePHP 1.3 install and it currently has one layout. I
I have just installed a fresh instance of SubText via the Web installer, I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.