[GENERAL] Ident authentication failed for user

2012-03-01 Thread Ruben Blanco
Hi:

I cannot connect to my Postgres database from my PHP scripts. I get the error:

   PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server:
FATAL:  Ident authentication failed for user postgres in ...


I have tried many combinations for host TYPE in pg_hba.conf
(restarting postmaster) without success:

# TYPE  DATABASEUSERCIDR-ADDRESS  METHOD

# local is for Unix domain socket connections only
local   all all   ident

# IPv4 local connections:
#20120301 rbz [1291-1292]
#hostall all 127.0.0.1/32 ident

# IPv6 local connections:
#20120301 rbz [1291-1292]
#hostall all ::1/128  ident

#20120301 rbz [1291-1292]
#hostall all 127.0.0.1/32 trust
#hostall all 0.0.0.0/0trust
#hostall all *trust
hostall all 127.0.0.1 255.255.255.255   trust
#hostall all localhosttrust
host allall ::1/128   trust


Isn't the las record the less restrictive configuration for host connections?

I can connect to psql witout any problem.

Thanks in advance for any help.

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Ident authentication failed for user

2012-03-01 Thread John R Pierce

On 03/01/12 9:02 AM, Ruben Blanco wrote:

I cannot connect to my Postgres database from my PHP scripts. I get the error:

PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server:
FATAL:  Ident authentication failed for user postgres in ...


I have tried many combinations for host TYPE in pg_hba.conf
(restarting postmaster) without success:

# TYPE  DATABASEUSERCIDR-ADDRESS  METHOD

# local is for Unix domain socket connections only
local   all all   ident

...
#hostall all *trust
hostall all 127.0.0.1 255.255.255.255   trust
#hostall all localhosttrust
host allall ::1/128   trust


Isn't the las record the less restrictive configuration for host connections?


specify host=localhost, otherwise its using the first 'local' line, 
which specifies 'ident' authentication, as the error implies.


you do realize, trust lets any process on the localhost authenticate as 
any user, including the postgres DBA account?



--
john r pierceN 37, W 122
santa cruz ca mid-left coast


--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Ident authentication failed for user

2012-03-01 Thread Ruben Blanco
Hi John. Thanks a lot for your reply:

El día 1 de marzo de 2012 17:25, John R Pierce pie...@hogranch.com escribió:
 On 03/01/12 9:02 AM, Ruben Blanco wrote:

 specify host=localhost, otherwise its using the first 'local' line, which
 specifies 'ident' authentication, as the error implies.

Where should I specify host=localhost? in the $connection_string for
pg_connect()? It doesn't work either.

I was understanding host TYPE was for TCP/IP connections only (my
scripts run through Apache web server). That's why I didn't expect the
local record to do anything with my connections. If I include this
record in the pg_hba.conf file I can connect to the database:

local   all all   trust


 you do realize, trust lets any process on the localhost authenticate as any
 user, including the postgres DBA account?

Yes, I just want to make it run, then will tighten security measures.

Thanks.

 --
 john r pierce                            N 37, W 122
 santa cruz ca                         mid-left coast


 --
 Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
 To make changes to your subscription:
 http://www.postgresql.org/mailpref/pgsql-general

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


Re: [GENERAL] Ident authentication failed for user

2012-03-01 Thread John R Pierce

On 03/01/12 10:03 AM, Ruben Blanco wrote:

El día 1 de marzo de 2012 17:25, John R Piercepie...@hogranch.com  escribió:

  On 03/01/12 9:02 AM, Ruben Blanco wrote:
  specify host=localhost, otherwise its using the first 'local' line, which
  specifies 'ident' authentication, as the error implies.

Where should I specify host=localhost? in the $connection_string for
pg_connect()? It doesn't work either.


I don''t do much PHP, so I might have the syntax wrong, but yes  it 
would go in the connection string passed to pg_Connection...  however 
you specify a host.  if you don't give a host at all, it uses the 
'domain' socket, which corresponds to the LOCAL line in pg_hba.conf...  
if you specify host is localhost, then it uses the host  127.0.0.1 
(or ::1) lines.


--
john r pierceN 37, W 122
santa cruz ca mid-left coast



--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[GENERAL] Ident authentication failed for user - URGENT

2006-12-05 Thread Marina Olhovsky
Hello,

I'm trying to assign a password for a postgres user.  I've logged in as 
postgres, issued alter user my_user with password 'my_passwd'.  Doing select 
* from pg_users shows the new user with password assigned.  However, when I 
try to start psql as the new user: psql -U my_user -W and enter my_passwd as 
password, I get Ident authentication failed error.  Could someone please help 
ASAP?  TIA.


Re: [GENERAL] Ident authentication failed for user - URGENT

2006-12-05 Thread Andreas Kretschmer
Marina Olhovsky [EMAIL PROTECTED] schrieb:

 
 Hello,
 
 I'm trying to assign a password for a postgres user.  I've logged in as
 postgres, issued alter user my_user with password 'my_passwd'.  Doing 
 select
 * from pg_users shows the new user with password assigned.  However, when I
 try to start psql as the new user: psql -U my_user -W and enter my_passwd as
 password, I get Ident authentication failed error.  Could someone please 
 help

Ident authentication means, that the actual user can identified with the
ident-service. I think, you should read more about authentification, for
instance there:

http://www.postgresql.org/docs/8.1/interactive/client-authentication.html


Andreas
-- 
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect.  (Linus Torvalds)
If I was god, I would recompile penguin with --enable-fly.(unknow)
Kaufbach, Saxony, Germany, Europe.  N 51.05082°, E 13.56889°

---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] Ident authentication failed for user - URGENT

2006-12-05 Thread brian

Marina Olhovsky wrote:

Hello,

I'm trying to assign a password for a postgres user.  I've logged in
as postgres, issued alter user my_user with password 'my_passwd'.
Doing select * from pg_users shows the new user with password
assigned.  However, when I try to start psql as the new user: psql
-U my_user -W and enter my_passwd as password, I get Ident
authentication failed error.  Could someone please help ASAP?  TIA.



Do you already have other users that can log in to psql? What does you 
pg_hba.conf file have? Can you create the user successfully with createuser?


Have you read the docs thoroughly?

http://www.postgresql.org/docs/8.1/interactive/client-authentication.html

brian

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


[GENERAL] Ident authentication failed for user dsivam

2006-11-30 Thread dsivam
Hi-

I've run into a problem using Postgres 8.1 that has me stumped:

I'm logged on as user 'postgres' and I can connect using the following
command:

bash$psql

However when I specify the host:

bash$psql -h localhost

or

bash$psql -h hostname.domain.com

I get the following error:

psql: FATAL:  Ident authentication failed for user postgres


I have the listen_address parameter set to * in postgresql.conf.

Below are the permissions in my pg_hba.conf:

# local is for Unix domain socket connections only
local   all all   ident sameuser
# IPv4 local connections:
hostall all 127.0.0.1/32  ident sameuser
# IPv6 local connections:
hostall all ::1/128   ident sameuser

Any Ideas?

Thanks...


---(end of broadcast)---
TIP 2: Don't 'kill -9' the postmaster


Re: [GENERAL] Ident authentication failed for user dsivam

2006-11-30 Thread Martijn van Oosterhout
On Tue, Nov 28, 2006 at 03:40:09PM -0800, [EMAIL PROTECTED] wrote:
 Hi-
 
 I've run into a problem using Postgres 8.1 that has me stumped:
 
 I'm logged on as user 'postgres' and I can connect using the following
 command:
 
 bash$psql
 
 However when I specify the host:
 
 bash$psql -h localhost

snip

Maybe you're not running an ident daemon?

Have a nice day,
-- 
Martijn van Oosterhout   kleptog@svana.org   http://svana.org/kleptog/
 From each according to his ability. To each according to his ability to 
 litigate.


signature.asc
Description: Digital signature


Re: [GENERAL] Ident authentication failed without su to user

2006-02-17 Thread jim_bowery
Yes.  It turns out the problem was that my pg_hba.conf file was
replaced by another file during a yum install of the new postgresql but
in a different path.  When I used locate pg_hba.conf it returned the
path of the old file which didn't have the 'ident sameuser' rule.


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


[GENERAL] Ident authentication failed without su to user

2006-02-16 Thread jim_bowery
I've created a database bugs and a user bugs (postgresql user as
well as unix) and even made user bugs not require a password but I
still get this:
[EMAIL PROTECTED] bugzilla-2.20]# psql bugs bugs
psql: FATAL:  Ident authentication failed for user bugs
...
but if I
[EMAIL PROTECTED] bugzilla-2.20]# su bugs
[EMAIL PROTECTED] bugzilla-2.20]$ psql bugs bugs
Welcome to psql 8.0.7, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
 \h for help with SQL commands
 \? for help with psql commands
 \g or terminate with semicolon to execute query
 \q to quit

bugs=

it works.  any ideas why?


---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

   http://www.postgresql.org/docs/faq


Re: [GENERAL] Ident authentication failed without su to user

2006-02-16 Thread Douglas McNaught
[EMAIL PROTECTED] writes:

 I've created a database bugs and a user bugs (postgresql user as
 well as unix) and even made user bugs not require a password but I
 still get this:
 [EMAIL PROTECTED] bugzilla-2.20]# psql bugs bugs
 psql: FATAL:  Ident authentication failed for user bugs

Because 'ident sameuser' means your Unix username has to be the same
as your PG username.  Note that 'root' != 'bugs'.

-Doug

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


Re: [GENERAL] Ident authentication failed without su to user

2006-02-16 Thread Chris

[EMAIL PROTECTED] wrote:

I've created a database bugs and a user bugs (postgresql user as
well as unix) and even made user bugs not require a password but I
still get this:
[EMAIL PROTECTED] bugzilla-2.20]# psql bugs bugs
psql: FATAL:  Ident authentication failed for user bugs
...
but if I
[EMAIL PROTECTED] bugzilla-2.20]# su bugs
[EMAIL PROTECTED] bugzilla-2.20]$ psql bugs bugs
Welcome to psql 8.0.7, the PostgreSQL interactive terminal.

Type:  \copyright for distribution terms
 \h for help with SQL commands
 \? for help with psql commands
 \g or terminate with semicolon to execute query
 \q to quit

bugs=

it works.  any ideas why?



Probably because of your pg_hba.conf file. The first option is most 
likely 'ident'.


You probably want it as 'md5' (the file itself has tons of documentation).

Order does matter in that file - it will use the first rule that applies.

---(end of broadcast)---
TIP 9: In versions below 8.0, the planner will ignore your desire to
  choose an index scan if your joining column's datatypes do not
  match


[GENERAL] Ident authentication failed

2006-01-02 Thread Lucky Leavell
v8.0.3
OS: SuSE 10.0 Pro

I am new to PostgreSQL but fairly familiar with other RDBMS' such as 
Ingres, Informix and MySQL.

I am attempting to switch from using MySQL to PostgreSQL with postfix. I 
have created the postfix user using createuser with a password but denying 
the ability to create databases or other users. However when I attempt to 
login even using psql:

psql -W -U postfix

it prompts me for the password and I enter the one that user was created 
with. The resulting error is:

psql: FATAL: Ident authentication failed for user 'postfix'

I know I must be missing something simple but I cannot find it in the docs 
or FAQs. Please point me in the right direction.

Thank you,
Lucky

---(end of broadcast)---
TIP 4: Have you searched our list archives?

   http://archives.postgresql.org


Re: [GENERAL] Ident authentication failed

2006-01-02 Thread Madison Kelly

Lucky Leavell wrote:

v8.0.3
OS: SuSE 10.0 Pro

I am new to PostgreSQL but fairly familiar with other RDBMS' such as 
Ingres, Informix and MySQL.


I am attempting to switch from using MySQL to PostgreSQL with postfix. I 
have created the postfix user using createuser with a password but denying 
the ability to create databases or other users. However when I attempt to 
login even using psql:


psql -W -U postfix

it prompts me for the password and I enter the one that user was created 
with. The resulting error is:


psql: FATAL: Ident authentication failed for user 'postfix'

I know I must be missing something simple but I cannot find it in the docs 
or FAQs. Please point me in the right direction.


Thank you,
Lucky


By default, PostgreSQL won't let you connect unless your system user 
account matches the user account in postgres... You can either 'su' to 
the 'postfix' user or edit your 'pg_hba.conf' file to have the line:


local all all  trust

Usually there will already be the line:

local all all  ident sameuser

Be aware though that this essentially opens postgres access to anyone 
with shell access. There are a few other ways to deal with them but the 
PostgreSQL docs do a better job at explaining it than I can.


HTH!

Madison

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  Madison Kelly (Digimer)
   TLE-BU; The Linux Experience, Back Up
Main Project Page:  http://tle-bu.org
Community Forum:http://forum.tle-bu.org
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-

---(end of broadcast)---
TIP 3: Have you checked our extensive FAQ?

  http://www.postgresql.org/docs/faq


Re: [GENERAL] Ident authentication failed

2006-01-02 Thread Lucky Leavell


On Mon, 2 Jan 2006, Madison Kelly wrote:

 Lucky Leavell wrote:
  v8.0.3
  OS: SuSE 10.0 Pro
  
  I am new to PostgreSQL but fairly familiar with other RDBMS' such as Ingres,
  Informix and MySQL.
  
  I am attempting to switch from using MySQL to PostgreSQL with postfix. I
  have created the postfix user using createuser with a password but denying
  the ability to create databases or other users. However when I attempt to
  login even using psql:
  
   psql -W -U postfix
  
  it prompts me for the password and I enter the one that user was created
  with. The resulting error is:
  
   psql: FATAL: Ident authentication failed for user 'postfix'
  
  I know I must be missing something simple but I cannot find it in the docs
  or FAQs. Please point me in the right direction.
  
  Thank you,
  Lucky
 
 By default, PostgreSQL won't let you connect unless your system user account
 matches the user account in postgres... You can either 'su' to the 'postfix'
 user or edit your 'pg_hba.conf' file to have the line:
 
 local all all  trust
 
 Usually there will already be the line:
 
 local all all  ident sameuser
 
 Be aware though that this essentially opens postgres access to anyone with
 shell access. There are a few other ways to deal with them but the PostgreSQL
 docs do a better job at explaining it than I can.

I tried your suggestion except substituting password for trust and 
it seems to work without giving the farm away! 

Many thanks,
Lucky

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