pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedTCPIP connection on local host using md5
2+ messages / 2 participants
[nested] [flat]
* TCPIP connection on local host using md5
@ 2012-10-12 21:48 Jimy McDermott <jmcdermott@catbird.com>
2012-10-14 20:15 ` Re: TCPIP connection on local host using md5 Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 2+ messages in thread
From: Jimy McDermott @ 2012-10-12 21:48 UTC (permalink / raw)
To: pgsql-admin
I am trying to connect a JDBC client to the PostgreSQL DB using a custom
user, "report".
The report user connects *successfully* from remote machines as expected.
The report user *cannot connect* from the JDBC client program on local host.
I cant figure out wht an ident server is being contaced, the auth method is
md5.
JDBC Client connection string:
"jdbc:postgresql://localhost:/<mydbname>"
Error:
LOG: could not connect to Ident server at address "127.0.0.1", port 113:
Connection refused
FATAL: Ident authentication failed for user "report"
postgres.conf:
#------------------------------------------------------------------------------
# CONNECTIONS AND AUTHENTICATION
#------------------------------------------------------------------------------
# - Connection Settings -
listen_addresses = '*' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost', '*' = all
# (change requires restart)
port = 5432 # (change requires restart)
pg_hba.conf:
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 ident
# IPv6 local connections:
host all all ::1/128 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
host all all 192.168.20.250/32 md5 #
This line supports the remote connection that works great
host all report 127.0.0.1/32 md5 #
This line is intended to support the local connection that is failing
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: TCPIP connection on local host using md5
2012-10-12 21:48 TCPIP connection on local host using md5 Jimy McDermott <jmcdermott@catbird.com>
@ 2012-10-14 20:15 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2012-10-14 20:15 UTC (permalink / raw)
To: Jimy McDermott <jmcdermott@catbird.com>; +Cc: pgsql-admin
Jimy McDermott <jmcdermott@catbird.com> writes:
> pg_hba.conf:
> # TYPE DATABASE USER ADDRESS METHOD
> # "local" is for Unix domain socket connections only
> local all all peer
> # IPv4 local connections:
> host all all 127.0.0.1/32 ident
> # IPv6 local connections:
> host all all ::1/128 ident
> # Allow replication connections from localhost, by a user with the
> # replication privilege.
> host all all 192.168.20.250/32 md5 #
> This line supports the remote connection that works great
> host all report 127.0.0.1/32 md5 #
> This line is intended to support the local connection that is failing
pg_hba.conf lines are considered in order, so the second one (with the
ident auth method) is matching the incoming connection before the last
one ever gets considered. You need to re-order those lines. The rule
of thumb is "most specific rule first".
regards, tom lane
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2012-10-14 20:15 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2012-10-12 21:48 TCPIP connection on local host using md5 Jimy McDermott <jmcdermott@catbird.com>
2012-10-14 20:15 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox