473,513 Members | 6,210 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 26562

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
5893
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
3014
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
1616
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
1413
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
25813
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
4787
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
5019
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
2155
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
2519
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
7153
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7373
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
7094
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7519
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5079
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3230
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3218
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.