Re: Linux user www-data has no access to amphora2 DB

From: David Stanaway <david(at)stanaway(dot)net>
To: Denny-Schierz <cuall(at)gmx(dot)de>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Linux user www-data has no access to amphora2 DB
Date: 2002-04-22 17:51:18
Message-ID: 1019497878.24392.69.camel@ciderbox
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Mon, 2002-04-22 at 12:32, Denny-Schierz wrote:
> Hi pgsql-admin,
>
> i want to install the amphora2 light groupware software under Debian Woody
> with pgsql 7.2.1. I have to restore a dump into the amphora2 DB that
> i created before.:
> -----------------
> testlinux:/home/amphora2/inst# su www-data -s /bin/bash -c 'psql amphora2 < amphora2.0.dump'
> -----------------
>
> but postgres tells me:

Does www-data exist as a postgres user?

I have tried to reproduce your problem, but I can't.

I don't have a password for www-data so I use sudo:

dstanawa(at)ciderbox:~$ sudo -u www-data psql -c "select version()"
template1
version
-----------------------------------------------------------------------
PostgreSQL 7.2.1 on powerpc-unknown-linux-gnu, compiled by GCC 2.95.4
(1 row)

dstanawa(at)ciderbox:~$ tail -11 /etc/postgresql/pg_hba.conf
local all ident
sameuser
#host all 127.0.0.1 255.0.0.0 trust
host all 0.0.0.0 0.0.0.0 reject

# If you want to allow non-local connections, you will need to change
'reject'
# to 'crypt' or some other suitable authentication method. (Debian
postgresql
# is not built with Kerberos authentication enabled.)
# To allow TCP/IP access, even from localhost, the postmaster must also
be
# started with the -i option or the option TCPIP_SOCKET must be set in
# /etc/postgresql/postgresql.conf.

dstanawa(at)ciderbox:~$ cat /etc/debian_version
3.0

> -----------------
> psql: FATAL 1: IDENT authentication failed for user "www-data"
> -----------------
>
> my pg_hba.conf:
>
> local amphora2 ident amphora
> local all ident sameuser
> host all 127.0.0.1 255.0.0.0 ident sameuser
> host all 0.0.0.0 0.0.0.0 reject

Anyway.. you probably want to restore the database as a super user (EG:
User Postgres) The dump script should have

\connect - "www-data"
statements in it. It also may have some
\connect - "postgresql"
statements too. which could cause problems as user www-data

--
David Stanaway

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2002-04-22 17:56:44 Re: Linux user www-data has no access to amphora2 DB
Previous Message Denny-Schierz 2002-04-22 17:42:46 Linux user www-data has no access to amphora2 DB_New