Re: Connect error

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Bill Moseley <moseley(at)hank(dot)org>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Connect error
Date: 2004-01-12 17:57:42
Message-ID: 20040112175742.GA27922@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Mon, Jan 12, 2004 at 09:29:00 -0800,
Bill Moseley <moseley(at)hank(dot)org> wrote:
>
> I was not able to get this configuration working, so I think I'm not
> understanding the documentation correctly. Or maybe I was expecting
> that "sameuser" would work:

sameuser says that the os username must match the postgres username.

> moseley(at)bumby:~$ createdb newdb
> CREATE DATABASE
>
> moseley(at)bumby:~$ psql newdb
> Welcome to psql 7.4.1, the PostgreSQL interactive terminal.
>
> Type: \copyright for distribution terms
> \h for help with SQL commands
> \? for help on internal slash commands
> \g or terminate with semicolon to execute query
> \q to quit
>
> newdb=> \q
>
> moseley(at)bumby:~$ su
> Password:
>
> bumby:/home/moseley# fgrep moseley /etc/postgresql/pg_ident.conf
> sameuser www-data moseley

Since sameuser is a special ident map you can't use it as a named map in
the pg_ident.conf map.

>
> bumby:/home/moseley# /etc/init.d/postgresql restart
> Stopping PostgreSQL database server: postmaster.
> Starting PostgreSQL database server: postmaster.
>
> bumby:/home/moseley# su www-data
>
> bumby:/home/moseley$ psql newdb
> psql: FATAL: user "www-data" does not exist
>
> bumby:/home/moseley$ psql -Umoseley newdb
> psql: FATAL: IDENT authentication failed for user "moseley"
>
>
> I even tried using my own map name instead of "sameuser".
>
> bumby:/etc/postgresql# fgrep testmap pg_hba.conf pg_ident.conf
> pg_hba.conf:host all all 127.0.0.1 255.255.255.255 ident testmap
> pg_ident.conf:testmap moseley www-data
>
> So I think I'm missing an important concept.

I think you are pretty close. In the last case you enabled ident authentication
using testmap for internet connections, but unless you did this for local
connections (domain sockets) as well, it wouldn't apply since the way you
are using psql will use a domain socket to connect (unless you have set
the PGHOST environment variable).

>
>
>
>
> --
> Bill Moseley
> moseley(at)hank(dot)org
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bill Moseley 2004-01-12 18:22:03 Re: [Ignor Whois] Re: Connect error
Previous Message Bill Moseley 2004-01-12 17:29:00 Re: Connect error