Passwords in PSQL

Started by Rafaqat Aliover 20 years ago3 messages
#1Rafaqat Ali
smoken0@gmail.com

Hello All
I am using
\c [database] [user-name]
to connect to any database.
Any one can connect to any database. If any one knows user
name, he/she connect to db. I want to provide some security that no
one can connect without providing passwords. postgres uses a function
do_coonect() for this perpose. I provide it passwords but it let me
connect to db with any passwords provided. Can any one tell me how to
set passwords for db user. and how can I implement password protection
in psql.

#2Gavin Sherry
swm@linuxworld.com.au
In reply to: Rafaqat Ali (#1)
Re: Passwords in PSQL

On Mon, 25 Apr 2005, Rafaqat Ali wrote:

Hello All
I am using
\c [database] [user-name]
to connect to any database.
Any one can connect to any database. If any one knows user
name, he/she connect to db. I want to provide some security that no
one can connect without providing passwords. postgres uses a function
do_coonect() for this perpose. I provide it passwords but it let me
connect to db with any passwords provided. Can any one tell me how to
set passwords for db user. and how can I implement password protection
in psql.

http://www.postgresql.org/docs/8.0/static/client-authentication.html

In particular: "authentication-method".

And:

http://www.postgresql.org/docs/8.0/static/sql-createuser.html

Please address general PostgreSQL questions to the pgsql-general mailing
list in the future.

Thanks

Gavin

#3Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Rafaqat Ali (#1)
Re: Passwords in PSQL

Any one can connect to any database. If any one knows user
name, he/she connect to db. I want to provide some security that no
one can connect without providing passwords. postgres uses a function
do_coonect() for this perpose. I provide it passwords but it let me
connect to db with any passwords provided. Can any one tell me how to
set passwords for db user. and how can I implement password protection
in psql.

You have to edit your pg_hba.conf and change trust authentication to md5.

Chris