Re: [INTERFACES] Re: connecting: unix socket? Yes. TCPIP port? No.-i? Yes. - Mailing list pgsql-interfaces

From Tom Lane
Subject Re: [INTERFACES] Re: connecting: unix socket? Yes. TCPIP port? No.-i? Yes.
Date
Msg-id 11081.918660135@sss.pgh.pa.us
Whole thread Raw
In response to Re: [INTERFACES] Re: connecting: unix socket? Yes. TCPIP port? No.-i? Yes.  (Bob VonMoss <bvonmoss@bigfoot.com>)
List pgsql-interfaces
Bob VonMoss <bvonmoss@bigfoot.com> writes:
> We've tried:
> host my_db 0.0.0.0   0.0.0.0 ident sameuser

As you already found out, that won't work if you're not running an ident
daemon on your connecting machine.  (You aren't *really* running with an
0.0.0.0 mask are you?  That means anyone anywhere on the net can get
into your database, if they can reach the machine it's on...)

> host my_db 0.0.0.0   0.0.0.0 password sameuser

See the documentation:

#   password:  Authentication is done by matching a password supplied in clear
#           by the host.  If AUTH_ARGUMENT is specified then the password
#              is compared with the user's entry in that file (in the $PGDATA
#           directory).  See pg_passwd(1).  If it is omitted then the
#           password is compared with the user's entry in the pg_shadow
#           table.

Unless your admin made a file named "sameuser" to store Postgres
passwords in, this will not work.  I think you want to remove "sameuser".
(Also, did he remember to set a Postgres password for you?)

> I'm hoping that it will eventually work through JDBC, but it doesn't
> work with
> psql -h my-isp.com -d my_db
> Same messages: "User authentication failed"

Even if the host system were correctly configured for password
authentication, this psql invocation would fail since you didn't supply
a username and password.  Need -u option.

            regards, tom lane

pgsql-interfaces by date:

Previous
From: Rich Shepard
Date:
Subject: Re: [INTERFACES] question on accessing PostgreSQL with C
Next
From: Atika
Date:
Subject: ODBC driver for Linux RedHat 5.1