pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
client authentication problem
5+ messages / 5 participants
[nested] [flat]

* client authentication problem
@ 2005-02-02 00:42 Dave Vieglais <vieglais@ku.edu>
  2005-02-03 06:10 ` Re: client authentication problem Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Dave Vieglais @ 2005-02-02 00:42 UTC (permalink / raw)
  To: pgsql-admin

Hi,
I have a problem connecting to a database when using tcp/ip with psql. 
Connecting with Unix sockets works fine.  TCP/IP is enabled, and the log 
shows a connection is made but authentication is rejected.

 From the error messages, it appears that the client and server negotiated 
to use crypt, or perhaps the client is trying to force using crypt rather 
than md5.

First guess is something like a version mist-match between client and server 
libraries, but this is a fresh install on Debian, installed using apt so 
that seems unlikely.  More information follows...

Details:
# uname -a
Linux tova 2.6.8-1-686 #1 Thu Nov 25 04:34:30 UTC 2004 i686 GNU/Linux

# psql -V
psql (PostgreSQL) 7.4.6
contains support for command-line editing

Contents of pg_hba.conf:

local  all  postgres                       ident sameuser
local  all  all                            md5
host   all  all  127.0.0.1 255.255.255.255 md5
host   all  all  0.0.0.0   0.0.0.0         reject


Examining pg_shadow indicates passwords are stored using MD5 encypting.


Connecting directly using Unix sockets works fine:

# psql testdb -U test
<connect ok>

Connecting over TCP/IP fails:

# psql testdb -U test -h localhost
<prompt for password, fail to connect, same with "127.0.0.1" or "localhost">
psql: FATAL:  Password authentication failed for user "test"

The log indicates that a connection was made (so TCP/IP seems to be working 
ok) but that the "crypt" authentication method is being used rather than "MD5":

# tail /var/log/postgresql/postgresql.log
LOG:  redo record is at 0/6851324; undo record is at 0/0; shutdown TRUE
LOG:  next transaction ID: 61873; next OID: 28747
LOG:  database system is ready
2005-01-31 16:03:23 [31418] LOG:  connection received: host=127.0.0.1 port=33377
2005-01-31 16:03:23 [31418] LOG:  cannot use authentication method "crypt" 
because password is MD5-encrypted
2005-01-31 16:03:23 [31418] FATAL:  Password authentication failed for user 
"test"

My understanding of the connection negotiation is that the client connects, 
the server suggests the encryption method to use and sends the salt to the 
client, the client is supposed to make the MD5 hash using Username, Password 
and Salt, and forward that back for authentication.  However it appears that 
something is failing at the negotiation stage, and the client is trying to 
use crypt, or perhaps the server is suggesting that crypt be used.

Any suggestions on how to correct this problem?

thanks,
   Dave V.




^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: client authentication problem
  2005-02-02 00:42 client authentication problem Dave Vieglais <vieglais@ku.edu>
@ 2005-02-03 06:10 ` Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 5+ messages in thread

From: Tom Lane @ 2005-02-03 06:10 UTC (permalink / raw)
  To: vieglais@ku.edu; +Cc: pgsql-admin

Dave Vieglais <vieglais@ku.edu> writes:
> Contents of pg_hba.conf:

> local  all  postgres                       ident sameuser
> local  all  all                            md5
> host   all  all  127.0.0.1 255.255.255.255 md5
> host   all  all  0.0.0.0   0.0.0.0         reject

> # tail /var/log/postgresql/postgresql.log
> LOG:  redo record is at 0/6851324; undo record is at 0/0; shutdown TRUE
> LOG:  next transaction ID: 61873; next OID: 28747
> LOG:  database system is ready
> 2005-01-31 16:03:23 [31418] LOG:  connection received: host=127.0.0.1 port=33377
> 2005-01-31 16:03:23 [31418] LOG:  cannot use authentication method "crypt" 
> because password is MD5-encrypted
> 2005-01-31 16:03:23 [31418] FATAL:  Password authentication failed for user 
> "test"

I'm fairly sure that this log entry is not possible unless the
postmaster found a pg_hba.conf entry specifying "crypt".  Accordingly
I suspect pilot error.  Perhaps you are looking at the wrong copy of
pg_hba.conf?  Or maybe you changed the file and forgot to SIGHUP the
postmaster?

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Client Authentication problem
@ 2005-04-27 16:43 Vaneet Sharma <vaneet@iwg.info>
  2005-04-27 17:13 ` Re: Client Authentication problem Scott Marlowe <smarlowe@g2switchworks.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Vaneet Sharma @ 2005-04-27 16:43 UTC (permalink / raw)
  To: pgsql-admin

Hello,

I am using postgreSQL 8.0.2

I configured the database, started postmaster. It is running well. I can
check and see it with ps anx command.

I am running postgreSQL on centos 3.4 and Centos 4.0 machines

Well, I created a database called test as well by command line on secure
CRT

Now the problem is that:
When I try to connect to my server using pgAdminIII, it is giving me the
following error :

"Error connecting to the server: could not connect to the server: No
route to host ( 0X00002751/10065).
Is the server running on host 212.xx.xxx.xxx and accepting TCP/IP
connections on port 5432?  "


I have read pg_hba file and also included the IP entry of my machine
from which I am connecting
Entry Is below:

host    all         all         192.168.50.122         255.255.255.0
trust

I have also changed postgreSQL.conf
1) I included listen_addresses = '*' on port 5432

Well, any help will be appreciated.
Also, can someone tell me where does postgreSQL put the DETAILED log on
CENTOS 4.0

I opened logfile ( in home directory of postgreSQL installation , it
does not give detailed log)

Well, I am a bit new to linux and also new to Administration and
Installation of postgres.

Kind Regards
Vaneet



Vaneet Sharma
executive manager	
iDeasTank Limited	
an iwg business
dolphins' court po 388
valletta, m-malta/europe
mobile:	 +356 9943 8263
skype:  CALLVANEET
fax:	 +356 9952 8888
phone:	 +356 9942 8888

vaneet@iwg.info
call me on www.skype.com - my ID is CALLVANEET

Want a signature like this? - www.plaxo.com\signature

iwg is a global e-mobile company creating, building and growing new businesses.  iwg founders are pioneers in creating multi-billion dollar mobile and Internet businesses in Europe, Asia and the US.

www.iWG.info
www.countryprofiler.com/iWG
www.visitmalta.com
www.mfc.com.mt


Privileged/Confidential Information may be contained in this message.  If you are not the addressee indicated in this message (or responsible for delivery of the message to such person), you may not copy or deliver this message to anyone. In such case, you should destroy this message and kindly notify the sender by reply email.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Client Authentication problem
  2005-04-27 16:43 Client Authentication problem Vaneet Sharma <vaneet@iwg.info>
@ 2005-04-27 17:13 ` Scott Marlowe <smarlowe@g2switchworks.com>
  2005-04-27 17:42   ` Re: Client Authentication problem Michael Fuhr <mike@fuhr.org>
  0 siblings, 1 reply; 5+ messages in thread

From: Scott Marlowe @ 2005-04-27 17:13 UTC (permalink / raw)
  To: Vaneet Sharma <vaneet@iwg.info>; +Cc: pgsql-admin

On Wed, 2005-04-27 at 11:43, Vaneet Sharma wrote:
> Hello,
> 
> I am using postgreSQL 8.0.2
> 
> I configured the database, started postmaster. It is running well. I
> can check and see it with ps anx command.
> 
> I am running postgreSQL on centos 3.4 and Centos 4.0 machines
> 
> Well, I created a database called test as well by command line on
> secure CRT
> 
> Now the problem is that:
> When I try to connect to my server using pgAdminIII, it is giving me
> the following error :
> 
> "Error connecting to the server: could not connect to the server: No
> route to host ( 0X00002751/10065).
> Is the server running on host 212.xx.xxx.xxx and accepting TCP/IP
> connections on port 5432?  "
> 
> 
> I have read pg_hba file and also included the IP entry of my machine
> from which I am connecting
> Entry Is below:
> 
> host    all         all         192.168.50.122         255.255.255.0  
> trust

This sounds like a networking problem right now.

I note that the IP you're trying to connect to has a 212.xxx.xxx.xxx
while the host you're connecting from needs to be 192.168.xxx.xxx. 
Since 192.168 is generally not routed around a lot, I'm guessing you've
got a dns  / etc/hosts issue but can't really be sure.

what does 'traceroute dbhostname' say?



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: Client Authentication problem
  2005-04-27 16:43 Client Authentication problem Vaneet Sharma <vaneet@iwg.info>
  2005-04-27 17:13 ` Re: Client Authentication problem Scott Marlowe <smarlowe@g2switchworks.com>
@ 2005-04-27 17:42   ` Michael Fuhr <mike@fuhr.org>
  0 siblings, 0 replies; 5+ messages in thread

From: Michael Fuhr @ 2005-04-27 17:42 UTC (permalink / raw)
  To: Scott Marlowe <smarlowe@g2switchworks.com>; +Cc: Vaneet Sharma <vaneet@iwg.info>; pgsql-admin

On Wed, Apr 27, 2005 at 12:13:14PM -0500, Scott Marlowe wrote:
> On Wed, 2005-04-27 at 11:43, Vaneet Sharma wrote:
> >
> > "Error connecting to the server: could not connect to the server: No
> > route to host ( 0X00002751/10065).
> > Is the server running on host 212.xx.xxx.xxx and accepting TCP/IP
> > connections on port 5432?  "
> > 
> > I have read pg_hba file and also included the IP entry of my machine
> > from which I am connecting
> > Entry Is below:
> > 
> > host    all         all         192.168.50.122         255.255.255.0  
> > trust
> 
> This sounds like a networking problem right now.

Or possibly a firewall problem.  Some firewalls/packet filters
return ICMP messages instead of silently dropping packets, and some
software then displays the connection failure as "no route to host"
(EHOSTUNREACH).  But I'd check the routing first.

-- 
Michael Fuhr
http://www.fuhr.org/~mfuhr/



^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2005-04-27 17:42 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-02 00:42 client authentication problem Dave Vieglais <vieglais@ku.edu>
2005-02-03 06:10 ` Tom Lane <tgl@sss.pgh.pa.us>
2005-04-27 16:43 Client Authentication problem Vaneet Sharma <vaneet@iwg.info>
2005-04-27 17:13 ` Re: Client Authentication problem Scott Marlowe <smarlowe@g2switchworks.com>
2005-04-27 17:42   ` Re: Client Authentication problem Michael Fuhr <mike@fuhr.org>

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