Re: [GENERAL] Database users Passwords
Re: [GENERAL] Database users Passwords
От:
Jeff Davis <pgsql@j-davis.com>
Дата:
On Tue, 2006-10-17 at 10:41 -0400, DEV wrote:
> Hello all,
>
> I have user information in a table that I want to use to add
> users to the user roles tables that are part of postgresql. My
> question is this: the passwords in my user table are in there as a
> text file with the data being encrypted using the crypt function, is
> there a way I can use this crypt password when I do a “CREATE ROLE
> userid LOGIN PASSWORD 'crypt password' NOSUPERUSER INHERIT NOCREATEDB
> NOCREATEROLE” I know that in the current CREATE ROLE I have listed
> will take a clear text password and encrypt it for me. What do I need
> to change to use an encrypted password?
>
If user is foo and password is bar, do:
=# select md5('barfoo');
LOG: duration: 0.140 ms statement: select md5('barfoo');
md5
----------------------------------
96948aad3fcae80c08a35c9b5958cd89
(1 row)
=# create role foo login password 'md596948aad3fcae80c08a35c9b5958cd89'
nosuperuser inherit nocreatedb nocreaterole;
This seems to be lacking in the docs. At least, the only place I found
this information was a user comment in the 8.0 docs. Is this already in
the 8.1 docs? Should we add a description of the way postgresql does the
md5 hashes in the CREATE ROLE section?
Regards,
Jeff Davis
Re: [GENERAL] Database users Passwords
От:
Peter Eisentraut <peter_e@gmx.net>
Дата:
Jeff Davis wrote: > This seems to be lacking in the docs. At least, the only place I > found this information was a user comment in the 8.0 docs. Is this > already in the 8.1 docs? Should we add a description of the way > postgresql does the md5 hashes in the CREATE ROLE section? This has been in the documentation at least as far back as 7.3. -- Peter Eisentraut http://developer.postgresql.org/~petere/
Re: [GENERAL] Database users Passwords
От:
Jeff Davis <pgsql@j-davis.com>
Дата:
On Tue, 2006-10-17 at 21:35 +0200, Peter Eisentraut wrote: > Jeff Davis wrote: > > This seems to be lacking in the docs. At least, the only place I > > found this information was a user comment in the 8.0 docs. Is this > > already in the 8.1 docs? Should we add a description of the way > > postgresql does the md5 hashes in the CREATE ROLE section? > > This has been in the documentation at least as far back as 7.3. > I took a second look, and I am not seeing anything in the CREATE ROLE docs that say you need to concatenate the user to the password before encrypting with md5. I saw that in a comment in the 8.0 docs, but I can't find it in the 8.1 docs. Can you please point me to a specific section? Regards, Jeff Davis