Re: [GENERAL] pg_hba.conf and crypt

From: Kevin Lo <jwlo(at)ms11(dot)hinet(dot)net>
To: Oliver Elphick <olly(at)lfix(dot)co(dot)uk>
Cc: Louis Zirkel III <lzirkel(at)cleverly(dot)com>, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] pg_hba.conf and crypt
Date: 1999-05-06 17:29:32
Message-ID: 3731D17B.B0F577FF@ms11.hinet.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Oliver Elphick wrote:

> This is a document I wrote some time ago on this subject. If any parts of
> it are no longer accurate, please let me know.
>
> ====================================
> How to use clear or encrypted passwords for PostgreSQL access:
> =============================================================
>
> Use lines such as
>
> local all password
> host 192.137.23 255.255.255.0 crypt
>
> in /etc/postgresql/pg_hba.conf; then you can use
>
> CREATE USER user WITH PASSWORD password...
>
> to create a new user with the specified password, or
>
> ALTER USER user WITH PASSWORD password...
>
> to change the password of an existing user. ANY USER with create-user
> privilege can ALTER a password for any user, *INCLUDING* the postgres
> super-user.
>
> If connecting with psql, use the -u option; the user is prompted for username
> and password. If you don't use -u, the connection fails.

Hi, Oliver,

I follow your instructions to do on my local machine, edit the file
pg_hba.conf:

local all password
host all 127.0.0.1 255.255.255.255 crypt

then I connect with psql, use the -u option, I got the following errors:

% psql -u
Username: postgres
Password:

User authentication failed
Connection to database 'postgres' failed.
User authentication failed

If I don't edit the file pg_hba.conf, I can connect template1
with no problem. I have run createuser and have created the user 'postgres'.
Would you like to tell me how to solve this problem, thanks.

-Kevin.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 1999-05-06 21:05:42 Re: [GENERAL] pg_hba.conf and crypt
Previous Message Louis Zirkel III 1999-05-06 16:02:03 Re: [GENERAL] pg_hba.conf and crypt