473,671 Members | 2,422 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("dbn ame=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 26580

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("dbn ame=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*******@postg resql.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*******@postg resql.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("dbn ame=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*******@postg resql.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("dbn ame=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*******@postg resql.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
5901
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 :- c:\inetpub\wwwroot\adotest\backup\myhols.mdb Provider error '80040e4d' Authentication failed.
2
3025
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 pg_pasword and added entries for the two users "test1" and "test2". But when i tried to connect "test" using
0
1623
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 database. HELP.. I know I'm writing (adding) something wrong... The user i'm using is a valid user in the workgroup associated with the DB. THanks CODE FOLLOWS.
0
1426
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! ------------------------------------------------------------------------------------------- Event Type: Information Event Source: ASP.NET 2.0.50727.0 Event Category: Web Event Event ID: 1315
6
25818
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 was on a minute timer). Event code: 4005 Event message: Forms authentication failed for the request. Reason: The ticket supplied has expired.
6
4798
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 page they are viewing doesn't even require a secure login.
0
5059
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. Then another error, from different user is this: Event code: 4005
0
2177
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) event = threading.Event() t.start_client(event) event.wait() if not t.is_active(): print 'SSH negotiation failed.'
0
2532
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 it necessery ? or may I have to install another program? 2- I have entered server's Ip insted of hostname.Is it correct? 3- I have creat a user in server machine with a password to connect. Am I right? 4- I use this code in clinet...
0
8401
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8926
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8824
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8603
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5703
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4227
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2818
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2060
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1815
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.