473,387 Members | 1,516 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,387 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 26554

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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.