public inbox for [email protected]  
help / color / mirror / Atom feed
From: DEV <[email protected]>
To: [email protected]
Subject: Re: Database users Passwords
Date: Tue, 17 Oct 2006 12:54:51 -0400
Message-ID: <008101c6f20c$f6babb80$0b01a8c0@LT003> (raw)
In-Reply-To: <[email protected]>


Okay but the issue I have is that I have the passwords already generated and
in crypt() format and would love to just use them if at all possible?

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Jeff Davis
Sent: Tuesday, October 17, 2006 12:36 PM
To: DEV
Cc: [email protected]; [email protected]
Subject: Re: [GENERAL] Database users Passwords

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



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
       choose an index scan if your joining column's datatypes do not
       match






view thread (11+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Database users Passwords
  In-Reply-To: <008101c6f20c$f6babb80$0b01a8c0@LT003>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox