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

Started by Tom Laneabout 27 years ago6 messagesgeneral
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Bob VonMoss <bvonmoss@bigfoot.com> writes:

[ can connect via unix socket, but not via TCP ]

The administrator says this is how postmaster is invoked:
/usr/local/pgsql/bin/postmaster -S -i -D /usr/local/pgsql/data -p 5432

OK, that eliminates the "forgot -i" gotcha.

James Thompson is almost certainly right that the problem is that
Postgres' pg_hba.conf file is not set up to allow connections from
whichever IP address you are connecting from.

We heard about a similar problem recently which turned out to be
due to use of "virtual server" IP addresses. I've forgotten now
whether Postgres saw the connection as coming from the virtual IP
address or the underlying machine's real address, but anyway it wasn't
what the user was expecting :-(.

regards, tom lane

#2Bob VonMoss
bvonmoss@bigfoot.com
In reply to: Tom Lane (#1)
Re: connecting: unix socket? Yes. TCPIP port? No. -i? Yes.

Tom Lane wrote:

Bob VonMoss <bvonmoss@bigfoot.com> writes:

[ can connect via unix socket, but not via TCP ]

The administrator says this is how postmaster is invoked:
/usr/local/pgsql/bin/postmaster -S -i -D /usr/local/pgsql/data -p 5432

OK, that eliminates the "forgot -i" gotcha.

James Thompson is almost certainly right that the problem is that
Postgres' pg_hba.conf file is not set up to allow connections from
whichever IP address you are connecting from.

We heard about a similar problem recently which turned out to be
due to use of "virtual server" IP addresses.

The pgsql administrator put a line in pg_hba.conf that looks like this,
where my_db is substituted for my database name:

host my_db 0.0.0.0 0.0.0.0 ident sameuser

I'm still getting the same 'User authentication failed' messages. Same thing
from JDBC. Do I need access to the 'template1' table also?

Here's a transcript of a session from the command line on the same machine
(with host, database and login id substituted):

bash$ psql my_db
Welcome to the POSTGRESQL interactive sql monitor:
Please read the file COPYRIGHT for copyright terms of POSTGRESQL

type \? for help on slash commands
type \q to quit
type \g or terminate with semicolon to execute query
You are currently connected to the database: my_db

ubf99=> \z
Couldn't find any tables!
ubf99=> \q
bash$ psql -h my-isp.com -p 5432 -d my_db -u
Username: login-id
Password:

Connection to database 'my_db' failed.
User authentication failedbash$
bash$
bash$ psql -h my-isp.com -d my_db
Connection to database 'my_db' failed.
User authentication failedbash$
bash$ psql -h my-isp.com -u my_db
Username: login-id
Password:

Connection to database 'my_db' failed.
User authentication failedbash$

--
Bob VonMoss
mailto:bvonmoss@bigfoot.com
from Chicago, IL

#3Peter T Mount
peter@retep.org.uk
In reply to: Bob VonMoss (#2)
Re: [INTERFACES] Re: connecting: unix socket? Yes. TCPIP port? No. -i? Yes.

On Sun, 7 Feb 1999, Bob VonMoss wrote:

Tom Lane wrote:

Bob VonMoss <bvonmoss@bigfoot.com> writes:

[ can connect via unix socket, but not via TCP ]

The administrator says this is how postmaster is invoked:
/usr/local/pgsql/bin/postmaster -S -i -D /usr/local/pgsql/data -p 5432

OK, that eliminates the "forgot -i" gotcha.

James Thompson is almost certainly right that the problem is that
Postgres' pg_hba.conf file is not set up to allow connections from
whichever IP address you are connecting from.

We heard about a similar problem recently which turned out to be
due to use of "virtual server" IP addresses.

The pgsql administrator put a line in pg_hba.conf that looks like this,
where my_db is substituted for my database name:

host my_db 0.0.0.0 0.0.0.0 ident sameuser

I'm still getting the same 'User authentication failed' messages. Same thing
from JDBC. Do I need access to the 'template1' table also?

no.

Is the machine you are running the java app or psql on running ident?

Here's a transcript of a session from the command

--
Peter T Mount peter@retep.org.uk
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
Java PDF Generator: http://www.retep.org.uk/pdf

#4Bob VonMoss
bvonmoss@bigfoot.com
In reply to: Peter T Mount (#3)
Re: [INTERFACES] Re: connecting: unix socket? Yes. TCPIP port? No.-i? Yes.

Peter T Mount wrote:

On Sun, 7 Feb 1999, Bob VonMoss wrote:

Tom Lane wrote:

Bob VonMoss <bvonmoss@bigfoot.com> writes:

[ can connect via unix socket, but not via TCP ]

The administrator says this is how postmaster is invoked:
/usr/local/pgsql/bin/postmaster -S -i -D /usr/local/pgsql/data -p 5432

OK, that eliminates the "forgot -i" gotcha.

James Thompson is almost certainly right that the problem is that
Postgres' pg_hba.conf file is not set up to allow connections from
whichever IP address you are connecting from.

We heard about a similar problem recently which turned out to be
due to use of "virtual server" IP addresses.

The pgsql administrator put a line in pg_hba.conf that looks like this,
where my_db is substituted for my database name:

host my_db 0.0.0.0 0.0.0.0 ident sameuser

I'm still getting the same 'User authentication failed' messages. Same thing
from JDBC.

Is the machine you are running the java app or psql on running ident?

Not that I know of. I'm requesting this from the administrator:

host my_db 0.0.0.0 0.0.0.0 password sameuser

--
Bob VonMoss
mailto:bvonmoss@bigfoot.com
from Chicago, IL

#5Peter T Mount
peter@retep.org.uk
In reply to: Bob VonMoss (#4)
Re: [INTERFACES] Re: connecting: unix socket? Yes. TCPIP port? No.-i? Yes.

On Mon, 8 Feb 1999, Bob VonMoss wrote:

Peter T Mount wrote:

On Sun, 7 Feb 1999, Bob VonMoss wrote:

Tom Lane wrote:

Bob VonMoss <bvonmoss@bigfoot.com> writes:

[ can connect via unix socket, but not via TCP ]

The administrator says this is how postmaster is invoked:
/usr/local/pgsql/bin/postmaster -S -i -D /usr/local/pgsql/data -p 5432

OK, that eliminates the "forgot -i" gotcha.

James Thompson is almost certainly right that the problem is that
Postgres' pg_hba.conf file is not set up to allow connections from
whichever IP address you are connecting from.

We heard about a similar problem recently which turned out to be
due to use of "virtual server" IP addresses.

The pgsql administrator put a line in pg_hba.conf that looks like this,
where my_db is substituted for my database name:

host my_db 0.0.0.0 0.0.0.0 ident sameuser

I'm still getting the same 'User authentication failed' messages. Same thing
from JDBC.

Is the machine you are running the java app or psql on running ident?

Not that I know of. I'm requesting this from the administrator:

host my_db 0.0.0.0 0.0.0.0 password sameuser

Yeah, he's changed it to ident. I'd go back to him, and get him to change
it to either password or crypt.

Peter

--
Peter T Mount peter@retep.org.uk
Main Homepage: http://www.retep.org.uk
PostgreSQL JDBC Faq: http://www.retep.org.uk/postgres
Java PDF Generator: http://www.retep.org.uk/pdf

#6Bob VonMoss
bvonmoss@bigfoot.com
In reply to: Peter T Mount (#3)
Re: [INTERFACES] Re: connecting: unix socket? Yes. TCPIP port? No.-i? Yes.

Nothing's working, see latest developments at bottom.

Peter T Mount wrote:

On Sun, 7 Feb 1999, Bob VonMoss wrote:

Tom Lane wrote:

Bob VonMoss <bvonmoss@bigfoot.com> writes:

[ can connect via unix socket, but not via TCP ]

The administrator says this is how postmaster is invoked:
/usr/local/pgsql/bin/postmaster -S -i -D /usr/local/pgsql/data -p 5432

OK, that eliminates the "forgot -i" gotcha.

James Thompson is almost certainly right that the problem is that
Postgres' pg_hba.conf file is not set up to allow connections from
whichever IP address you are connecting from.

We heard about a similar problem recently which turned out to be
due to use of "virtual server" IP addresses.

The pgsql administrator put a line in pg_hba.conf that looks like this,
where my_db is substituted for my database name:

host my_db 0.0.0.0 0.0.0.0 ident sameuser

I'm still getting the same 'User authentication failed' messages. Same thing
from JDBC. Do I need access to the 'template1' table also?

no.

Is the machine you are running the java app or psql on running ident?

We've tried:
host my_db 0.0.0.0 0.0.0.0 ident sameuser
host my_db 0.0.0.0 0.0.0.0 password sameuser

Same messages: "User authentication failed"
I'm hoping that it will eventually work through JDBC, but it doesn't work with
psql -h my-isp.com -d my_db
where my-isp.com and my_db are substitutes for the real things. I'm running psql
on their computer when I telnet there. I don't know what ident is, but it's only
on their computer. 'password' didn't work either. I don't know what the problem
is. I'm exhausting my possibilities here. Yes, the postmaster is launched with -i.

I only created 'my_db' with the command 'createdb my_db' from a unix prompt on the
host. I don't have to run something like 'createdb -d dezines.com my_db', right?

--
Bob VonMoss
mailto:bvonmoss@bigfoot.com
from Chicago, IL