473,287 Members | 1,927 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

authentication failed

Why happens this?

Warning: pg_connect() unable to connect to PostgreSQL server: FATAL:
IDENT authentication failed for user "bchytrek" in
/var/www/html/physio2/test.php on line 19

The php-statement is :

$conn = pg_connect("dbname=testdb user=bchytrek");

the owner of that testdb is bchytrek and he does not have a password, he
is in the users-list as superuser, an may cerate dbs.

So why does the authentication fail?

Helpless

Bogdan
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 12 '05 #1
4 26541

Bogdan Chytrek wrote:
Why happens this?

Warning: pg_connect() unable to connect to PostgreSQL server: FATAL:
IDENT authentication failed for user "bchytrek" in
/var/www/html/physio2/test.php on line 19

The php-statement is :

$conn = pg_connect("dbname=testdb user=bchytrek");

the owner of that testdb is bchytrek and he does not have a password, he
is in the users-list as superuser, an may cerate dbs.

So why does the authentication fail?

Check your pg_hba.conf and postgresql.conf files.

I bet you forgot to turn on tcp/ip sockets, didn't you ;-)

On my RedHat 9 box:

-- /var/lib/pgsql/data/pg_hba.conf

#TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD
local all all trust
host all all 0.0.0.0 0.0.0.0 trust

-- /var/lib/pgsql/data/postgresql.conf

tcpip_socket = true

Try starting with something like THIS ... then tighten the security
after you get it to start working.

Dante


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #2
ro*****@t-online.de (Bogdan Chytrek) writes:
So why does the authentication fail?


Because the PHP script is not running as Unix user bchytrek (most likely
that process runs under some daemon userid or other). When you are
using IDENT authentication, your Unix user name has to match your
Postgres user name.

You could possibly work around that by creating an IDENT map that allows
the PHP daemon user to be accepted as bchytrek; see the admin guide for
details. But more likely you'll just want to switch to a different
authentication method.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #3
Hi Bogdan;

This is a typical problem when you install PosgreSQL via the Red Hat CD's.

You need to edit the pg_hba.conf and change the authentication type to more
appropriate settings. If your PHP app connects using a host field in the
connection string, it will be using a network socket. Otherwise, it will be
a local socket.

I usually set my servers to use md5 authentication for all network
connections and trust for local connections, allowing the admin to connect
locally as any user, but this assumes a level of security and architecture
you may not wish to assume. md5 authentication on both local and network
sockets will force password authentication for all connections via a
zero-knowledge md5-sum authentication method.

Best Wishes,
Chris Travers

----- Original Message -----
From: "Bogdan Chytrek" <ro*****@t-online.de>
To: <pg***********@postgresql.org>
Sent: Thursday, December 18, 2003 6:26 PM
Subject: [GENERAL] authentication failed
Why happens this?

Warning: pg_connect() unable to connect to PostgreSQL server: FATAL:
IDENT authentication failed for user "bchytrek" in
/var/www/html/physio2/test.php on line 19

The php-statement is :

$conn = pg_connect("dbname=testdb user=bchytrek");

the owner of that testdb is bchytrek and he does not have a password, he
is in the users-list as superuser, an may cerate dbs.

So why does the authentication fail?

Helpless

Bogdan
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #4
Hi Bogdan;

This is a typical problem when you install PosgreSQL via the Red Hat CD's.

You need to edit the pg_hba.conf and change the authentication type to more
appropriate settings. If your PHP app connects using a host field in the
connection string, it will be using a network socket. Otherwise, it will be
a local socket.

I usually set my servers to use md5 authentication for all network
connections and trust for local connections, allowing the admin to connect
locally as any user, but this assumes a level of security and architecture
you may not wish to assume. md5 authentication on both local and network
sockets will force password authentication for all connections via a
zero-knowledge md5-sum authentication method.

Best Wishes,
Chris Travers

----- Original Message -----
From: "Bogdan Chytrek" <ro*****@t-online.de>
To: <pg***********@postgresql.org>
Sent: Thursday, December 18, 2003 6:26 PM
Subject: [GENERAL] authentication failed
Why happens this?

Warning: pg_connect() unable to connect to PostgreSQL server: FATAL:
IDENT authentication failed for user "bchytrek" in
/var/www/html/physio2/test.php on line 19

The php-statement is :

$conn = pg_connect("dbname=testdb user=bchytrek");

the owner of that testdb is bchytrek and he does not have a password, he
is in the users-list as superuser, an may cerate dbs.

So why does the authentication fail?

Helpless

Bogdan
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to ma*******@postgresql.org so that your
message can get through to the mailing list cleanly

Nov 12 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Teggaman | last post by:
Hi, I'm trying to set up my home pc with 2000 pro IIS 5 installed. After writing a simple asp page to open a database and pull back the records of a table to test, I am getting an error :- ...
2
by: Manu M P | last post by:
Hi I have the data base "test" and two users "test1" "test2". I added the following record to pg_hba.conf local test password passwords I then created the "passwords" file in $PGDATA using...
0
by: Mike | last post by:
Ok so heres the code.. for some reason I kept getting the no permissions message, so I attempted to add the workgroup file. Now I get the "Authentication Failed" message. This is a secure...
0
by: needInstaller3.0 | last post by:
I have upgraded the server with framework 2.0 and move one of the sites from ASP.NET 1.1 to 2.0 and I got this error once a while in the error log. Does anyone know how to fix this? Thanks! ...
6
by: Gibble | last post by:
Hi, We have a javascript on a page that calls a .NET web service. Oddly, in our web servers event logs the following errors kept repeating every minute (that made sense since the web service...
6
by: Les Caudle | last post by:
Running ASP.NET 2.0 on Windows 2003. Getting events in App log for Event code: 4005 Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired. The...
0
by: ketax | last post by:
Hi expert, I am getting this type of error 2 times from one user: Event code: 4009 Event message: Viewstate verification failed. Reason: The viewstate supplied failed integrity check. ...
0
by: sa6113 | last post by:
I am using this code to connect to a windows machine using paramiko, I have installed sshd on the machine and it works properly: sock.connect((hostname, port)) t = paramiko.Transport(sock)...
0
by: sa6113 | last post by:
I want to connect to a Windows machine in my network , using ssh, I use paramiko but I have problem in authentication, would you please help me? 1- I have installed freeSSHD in server machine? Is...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.