Postgresql does not ask for a password

I have postgresql 8.3 db configured on linux box, along with postgres user Pg_hba.conf reads

local   all         postgres                          ident sameuser
local   all         all                               md5

therefore, there are no reliable connections from the local machine.

However, when connecting via the command line with psql, the password is not requested, and all users get access to all databases.

I am completely lost here.

+5
source share
3 answers

Are you sure you restarted or restarted PostgreSQL after changing pg_hba.conf?

If yes, enter this command from the postgres (shell) system account:

psql -qAt -c "show hba_file" | xargs grep -v -E '^[[:space:]]*#'

If this does not help, show us the output of the command.

+6
source

You must change both lines for IPv4 and IPv6 in pg_hba.conf

# IPv4 local connections:
host    all         all         127.0.0.1/32          md5
# IPv6 local connections:
host    all         all         ::1/128               md5

.

+1

Try

 host   all   all   127.0.0.1/32        md5

.

0

All Articles