Обсуждение: pg_hba.conf + all + trust = Ident authentication failed for user "postgres"

Поиск
Список
Период
Сортировка

pg_hba.conf + all + trust = Ident authentication failed for user "postgres"

От
ow
Дата:
PostgreSQL 8.1.0 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3 20051111
(prerelease) (Debian 4.0.2-4)


Hi,

Can't get pg_hba.conf with trust to work:

  testusr@test1:~$ psql -U postgres
  psql: FATAL:  Ident authentication failed for user "postgres"

If I do "su postgres" and then "psql -U postgres" then it does work. But I need
testusr to be able to use psql.

Installed "gidentd", rebooted psql but that did not seem to help.

Any ideas? Thanks in advance

--------------------------------------------------------------------------

$ cat pg_hba.conf
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
# IPv6 local connections:
host    all         all         ::1/128               trust

--------------------------------------------------------------------------


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Re: pg_hba.conf + all + trust = Ident authentication failed for user "postgres"

От
"Andy Shellam"
Дата:
Does your pg_ident.conf contain anything with reference to testusr? As it
seems to be trying Ident authentication over everything else and failing.

Andy


-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of ow
Sent: Monday, 06 March, 2006 1:02 PM
To: pgsql-admin@postgresql.org
Subject: [ADMIN] pg_hba.conf + all + trust = Ident authentication failed for
user "postgres"

PostgreSQL 8.1.0 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3
20051111
(prerelease) (Debian 4.0.2-4)


Hi,

Can't get pg_hba.conf with trust to work:

  testusr@test1:~$ psql -U postgres
  psql: FATAL:  Ident authentication failed for user "postgres"

If I do "su postgres" and then "psql -U postgres" then it does work. But I
need
testusr to be able to use psql.

Installed "gidentd", rebooted psql but that did not seem to help.

Any ideas? Thanks in advance

--------------------------------------------------------------------------

$ cat pg_hba.conf
# TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD

# "local" is for Unix domain socket connections only
local   all         all                               trust
# IPv4 local connections:
host    all         all         127.0.0.1/32          trust
# IPv6 local connections:
host    all         all         ::1/128               trust

--------------------------------------------------------------------------


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

---------------------------(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

!DSPAM:14,440c330a49416961194852!




Re: pg_hba.conf + all + trust = Ident authentication failed for user "postgres"

От
ow
Дата:
No, pg_ident.conf is empty (i.e. contains only comments). My impression was
that with "trust" nothing was needed in pg_ident.conf, no?

Thanks


--- Andy Shellam <andy.shellam@mailnetwork.co.uk> wrote:

> Does your pg_ident.conf contain anything with reference to testusr? As it
> seems to be trying Ident authentication over everything else and failing.
>
> Andy
>

---------------------------------------------------------------------------


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Re: pg_hba.conf + all + trust = Ident authentication failed for user "postgres"

От
"Andy Shellam"
Дата:
No you're right, there shouldn't be anything in pg_ident.conf.

Check in your postgresql.conf file, and set "listen_interfaces" to *, so it
listens on TCP/IP (if not already.)

Then try connecting with "psql -U postgres -h localhost" and see if that
lets you on.  Also check your postgresql.conf file is not forcing pgSQL to
look elsewhere for your config files.

Andy

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of ow
Sent: Monday, 06 March, 2006 1:21 PM
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] pg_hba.conf + all + trust = Ident authentication failed
for user "postgres"


No, pg_ident.conf is empty (i.e. contains only comments). My impression was
that with "trust" nothing was needed in pg_ident.conf, no?

Thanks


--- Andy Shellam <andy.shellam@mailnetwork.co.uk> wrote:

> Does your pg_ident.conf contain anything with reference to testusr? As it
> seems to be trying Ident authentication over everything else and failing.
>
> Andy
>

---------------------------------------------------------------------------


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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

!DSPAM:14,440c377449413902250303!




Re: pg_hba.conf + all + trust = Ident authentication failed for user "postgres"

От
ow
Дата:
In postgresql.conf I have "#listen_addresses = 'localhost'" and I am logged in
directly into the box, without telnet, ssh or whatever.

But "psql -U postgres -h localhost" DID WORK (after I entered the password) and
that's a big step forward, thanks.

I'm still not sure why I needed to enter the password, though... my idea of
"trust" is somewhat different...


--- Andy Shellam <andy.shellam@mailnetwork.co.uk> wrote:

> No you're right, there shouldn't be anything in pg_ident.conf.
>
> Check in your postgresql.conf file, and set "listen_interfaces" to *, so it
> listens on TCP/IP (if not already.)
>
> Then try connecting with "psql -U postgres -h localhost" and see if that
> lets you on.  Also check your postgresql.conf file is not forcing pgSQL to
> look elsewhere for your config files.
>
> Andy
>




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Re: pg_hba.conf + all + trust = Ident authentication failed

От
Stephan Szabo
Дата:
On Mon, 6 Mar 2006, ow wrote:

> PostgreSQL 8.1.0 on i486-pc-linux-gnu, compiled by GCC cc (GCC) 4.0.3 20051111
> (prerelease) (Debian 4.0.2-4)
>
>
> Hi,
>
> Can't get pg_hba.conf with trust to work:
>
>   testusr@test1:~$ psql -U postgres
>   psql: FATAL:  Ident authentication failed for user "postgres"

Are you sure you're using the configuration below (ie, you're editing the
correct file and have at least used sighup after the change)?  It sure
looks like the server thinks the method is ident which would be the
default for the debian packages I think.

> Any ideas? Thanks in advance
>
> --------------------------------------------------------------------------
>
> $ cat pg_hba.conf
> # TYPE  DATABASE    USER        CIDR-ADDRESS          METHOD
>
> # "local" is for Unix domain socket connections only
> local   all         all                               trust
> # IPv4 local connections:
> host    all         all         127.0.0.1/32          trust
> # IPv6 local connections:
> host    all         all         ::1/128               trust
>
> --------------------------------------------------------------------------
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> ---------------------------(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
>

Re: pg_hba.conf + all + trust = Ident authentication failed for user "postgres"

От
"Andy Shellam"
Дата:
To me it would suggest that pgSQL is not looking at the pg_hba.conf you
think it is - as it shouldn't prompt for a password when trust
authentication is set (it doesn't on my box when connecting via a socket.)

Also you mention that your listen_address looks like "#listen_addresses" -
in which case it's commented out, and so PG would *NOT* listen on TCP/IP, so
you shouldn't be able to connect using -h localhost - you should get
"connection refused".

I think you've got a case of duplicate config files on your system and PG is
looking at different files to the ones you're editing.

Might be worth running "find / -name pg_hba.conf" and "find / -name
postgresql.conf" to see where all the instances of your config files lie.

Something's not quite right...

Andy

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of ow
Sent: Monday, 06 March, 2006 1:59 PM
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] pg_hba.conf + all + trust = Ident authentication failed
for user "postgres"


In postgresql.conf I have "#listen_addresses = 'localhost'" and I am logged
in
directly into the box, without telnet, ssh or whatever.

But "psql -U postgres -h localhost" DID WORK (after I entered the password)
and
that's a big step forward, thanks.

I'm still not sure why I needed to enter the password, though... my idea of
"trust" is somewhat different...


--- Andy Shellam <andy.shellam@mailnetwork.co.uk> wrote:

> No you're right, there shouldn't be anything in pg_ident.conf.
>
> Check in your postgresql.conf file, and set "listen_interfaces" to *, so
it
> listens on TCP/IP (if not already.)
>
> Then try connecting with "psql -U postgres -h localhost" and see if that
> lets you on.  Also check your postgresql.conf file is not forcing pgSQL to
> look elsewhere for your config files.
>
> Andy
>




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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

!DSPAM:14,440c406f49419332837813!




Re: [SOLVED] pg_hba.conf + all + trust = Ident authentication failed

От
ow
Дата:

--- Stephan Szabo <sszabo@megazone.bigpanda.com> wrote:

> Are you sure you're using the configuration below (ie, you're editing the

I was sure... :-)

> correct file and have at least used sighup after the change)? It sure
> looks like the server thinks the method is ident which would be the
> default for the debian packages I think.
>

But now I looked and, yes, in debian, the server uses config files from
/etc/postgresql/8.1/main/, where it has "ident sameuser" and I was editing the
files in /var/lib/postgresql/8.1/main/, my data directory.

Now it works. Thanks to everyone who responded.




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

Re: [SOLVED] pg_hba.conf + all + trust = Ident authentication failed

От
"Andy Shellam"
Дата:
You could always symlink the debian config files to your correct ones.

Andy

-----Original Message-----
From: pgsql-admin-owner@postgresql.org
[mailto:pgsql-admin-owner@postgresql.org] On Behalf Of ow
Sent: Monday, 06 March, 2006 3:46 PM
To: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] [SOLVED] pg_hba.conf + all + trust = Ident
authentication failed



--- Stephan Szabo <sszabo@megazone.bigpanda.com> wrote:

> Are you sure you're using the configuration below (ie, you're editing the

I was sure... :-)

> correct file and have at least used sighup after the change)? It sure
> looks like the server thinks the method is ident which would be the
> default for the debian packages I think.
>

But now I looked and, yes, in debian, the server uses config files from
/etc/postgresql/8.1/main/, where it has "ident sameuser" and I was editing
the
files in /var/lib/postgresql/8.1/main/, my data directory.

Now it works. Thanks to everyone who responded.




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

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

!DSPAM:14,440c595e49411415720386!