Need help with pg_hba.conf, CREATE USER and password authentication

From: "Olsen, James" <jolsen(at)multi-ad(dot)com>
To: pgsql-admin(at)hub(dot)org
Subject: Need help with pg_hba.conf, CREATE USER and password authentication
Date: 1999-01-27 22:58:29
Message-ID: 4.1.19990127155535.009d9890@pop2.multi-ad.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hello all,

I'm using PostGre 6.3 on a Linux box and connecting to it via ODBC from Win98.

My pg_shadow table has the following record (example):

usename
|usesysid|usecreatedb|usetrace|usesuper|usecatupd|passwd|valuntil

--------+--------+-----------+--------+--------+---------+------+-----------
-----------------
bob | 506|f |t |f |t |smith |

There is only one table in this database, named "testtable". I created the user
bob while logged in as a super-user in the database "testdb":

CREATE USER bob WITH PASSWORD smith;
GRANT ALL TO bob ON testtable;

My pg_hba.conf has three lines (only one in effect at a time, the other two are
commented out):

#host all 123.12.34.123 255.255.255.0 trust
#host all 123.12.34.123 255.255.255.0 crypt
host all 123.12.34.123 255.255.255.0 password

My problem is this. If I use the "trust" line:

host all 123.12.34.123 255.255.255.0 trust

I can log in just fine with my ODBC driver to that database and read the table
just fine, as bob smith. However, if I change it to

host all 123.12.34.123 255.255.255.0 password

I get "database doesn't exist or authorization failed" message. I know the
table exists because I can use it in "trust" mode, and I know the username and
password I'm using is correct. From what I gather in the documentation the
"password" method with no parameters authenticates in the clear from the
pg_shadow table, which to me, is populated correctly.

What am I setting up incorrectly?

Another question, if I crypt() the passwords in pg_shadow, can I then use

host all 123.12.34.123 255.255.255.0 crypt

and still have it pull the encrypted passwords from pg_shadow?

Thank you for your guidance,

--James
============================================================================
james(at)dpc(dot)net ICQ # 1585849 http://www.dpc.net/~james
Senior Software Architect, Multi-Ad Services, Inc. http://www.multi-ad.com
Web Administrator of SoundCentral http://www.soundcentral.com
Part of Web Administration team of AllianceIT http://www.allianceit.net

Browse pgsql-admin by date

  From Date Subject
Next Message Dalphin, Mark 1999-01-28 01:10:03 RE: Request of information about Postgresql database for Irix 6.4
Previous Message Adam Di Carlo 1999-01-27 22:21:53 web page error