I’m trying to register new server in pgadmin3 with following settings:
Name: postgres
Host: localhost
Username: postgres
Password: <password which works for psql>
Service: empty or postgres
But it shows error:
FATAL: Ident authentification failed for user "postgres"
I’ve restarted postgresql service, but to no avail.
Contents of /var/lib/pgsql/data/pg_hba.conf:
# TYPE DATABASE USER CIDR-ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 ident
EDIT: Tools -> Server Configuration -> pg_hba.conf is greyed out.
It looks like PgAdmin-III is probably connecting over IPv6 by default, so it’s using the
identline that matches the IPv6 address for localhost,::1/128.If you want to use password authentication, you probably want:
I’m not sure why you have the unix domain socket line set to
trust, but that’s probably OK if it’s just a development machine, so leave it unchanged. It’s really much safer to have it asident(if you want the unix user to have to be the same as the Pg user) ormd5(for password auth on local unix sockets) though.You’ll need to edit
pg_hba.confdirectly in a text editor if PgAdmin-III doesn’t have permissions to edit it. You could run PgAdmin-III as userpostgresviasudo, but it’s way safer (and probably easier) to just usenanoor a similar command-line text editor to modifypg_hba.conf.The password works for
psqlbecausepsqlwill, unless told otherwise, connect over a unix domain socket, and you have that set totrust. You’ll probably find you could give any password topsqland it’ll still work, because it’s never being asked to actually give the password, it’s just being automatically trusted.