pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
create user xxx with md5 string?
5+ messages / 3 participants
[nested] [flat]

* create user xxx with md5 string?
@ 2009-12-03 18:05 Gerardo Herzig <gherzig@fmed.uba.ar>
  2009-12-03 19:21 ` Re: create user xxx with md5 string? Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Gerardo Herzig @ 2009-12-03 18:05 UTC (permalink / raw)
  To: pgsql-sql

Hi all. Im triyng, with no success, to create a user, and set the
password with a md5 string.

I did this:

comechingon:~ # echo -n 123 | md5sum
202cb962ac59075b964b07152d234b70  -


Ok, so then
test=# CREATE USER foobar ENCRYPTED PASSWORD
'md5202cb962ac59075b964b07152d234b70'; --I have to add 'md5' at the
begging of the string
CREATE ROLE


test=# SELECT * from pg_shadow where usename='foobar';
 usename | usesysid | usecreatedb | usesuper | usecatupd |
 passwd                | valuntil | useconfig
---------+----------+-------------+----------+-----------+-------------------------------------+----------+-----------
 foobar  |  3250592 | f           | f        | f         |
md5202cb962ac59075b964b07152d234b70 |          |
(1 row)

test=# \c test foobar
Password for user foobar: [123, off course]
FATAL:  password authentication failed for user "foobar"
Previous connection kept

test=# SHOW server_version;
 server_version
----------------
 8.3.6

Im wondering which my mystake is:
Using md5sum?

I do have 'md5' as validation mechanism in pg_hba.conf

Any hints?
Thanks!

Gerardo



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: create user xxx with md5 string?
  2009-12-03 18:05 create user xxx with md5 string? Gerardo Herzig <gherzig@fmed.uba.ar>
@ 2009-12-03 19:21 ` Tom Lane <tgl@sss.pgh.pa.us>
  2009-12-03 19:02   ` Re: create user xxx with md5 string? Gerardo Herzig <gherzig@fmed.uba.ar>
  2009-12-03 19:36   ` Re: create user xxx with md5 string? Dmitriy Igrishin <dmitigr@gmail.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Tom Lane @ 2009-12-03 19:21 UTC (permalink / raw)
  To: Gerardo Herzig <gherzig@fmed.uba.ar>; +Cc: pgsql-sql

Gerardo Herzig <gherzig@fmed.uba.ar> writes:
> Hi all. Im triyng, with no success, to create a user, and set the
> password with a md5 string.

The correct method for computing the md5'd password includes the
username.  I think it's 'md5' || md5sum(password || username)
but look at the code or docs.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: create user xxx with md5 string?
  2009-12-03 18:05 create user xxx with md5 string? Gerardo Herzig <gherzig@fmed.uba.ar>
  2009-12-03 19:21 ` Re: create user xxx with md5 string? Tom Lane <tgl@sss.pgh.pa.us>
@ 2009-12-03 19:02   ` Gerardo Herzig <gherzig@fmed.uba.ar>
  1 sibling, 0 replies; 5+ messages in thread

From: Gerardo Herzig @ 2009-12-03 19:02 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-sql

Tom Lane wrote:
> Gerardo Herzig <gherzig@fmed.uba.ar> writes:
>> Hi all. Im triyng, with no success, to create a user, and set the
>> password with a md5 string.
> 
> The correct method for computing the md5'd password includes the
> username.  I think it's 'md5' || md5sum(password || username)
> but look at the code or docs.
> 
> 			regards, tom lane
> 
Perfect! I could not find that in the docs.
It works. Thanks!

Gerardo



^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: create user xxx with md5 string?
  2009-12-03 18:05 create user xxx with md5 string? Gerardo Herzig <gherzig@fmed.uba.ar>
  2009-12-03 19:21 ` Re: create user xxx with md5 string? Tom Lane <tgl@sss.pgh.pa.us>
@ 2009-12-03 19:36   ` Dmitriy Igrishin <dmitigr@gmail.com>
  2009-12-03 19:38     ` Re: create user xxx with md5 string? Dmitriy Igrishin <dmitigr@gmail.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Dmitriy Igrishin @ 2009-12-03 19:36 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Gerardo Herzig <gherzig@fmed.uba.ar>; pgsql-sql

Hello all.
Tom right. Encrypted MD5 passwords computed as md5(password || test10). I
checked.

Regards, Dmitriy Igrishin.

2009/12/3 Tom Lane <tgl@sss.pgh.pa.us>

> Gerardo Herzig <gherzig@fmed.uba.ar> writes:
> > Hi all. Im triyng, with no success, to create a user, and set the
> > password with a md5 string.
>
> The correct method for computing the md5'd password includes the
> username.  I think it's 'md5' || md5sum(password || username)
> but look at the code or docs.
>
>                        regards, tom lane
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: create user xxx with md5 string?
  2009-12-03 18:05 create user xxx with md5 string? Gerardo Herzig <gherzig@fmed.uba.ar>
  2009-12-03 19:21 ` Re: create user xxx with md5 string? Tom Lane <tgl@sss.pgh.pa.us>
  2009-12-03 19:36   ` Re: create user xxx with md5 string? Dmitriy Igrishin <dmitigr@gmail.com>
@ 2009-12-03 19:38     ` Dmitriy Igrishin <dmitigr@gmail.com>
  0 siblings, 0 replies; 5+ messages in thread

From: Dmitriy Igrishin @ 2009-12-03 19:38 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Gerardo Herzig <gherzig@fmed.uba.ar>; pgsql-sql

Sorry for my prev post. I mean md5(password || username).
'test10' is a username on which i checked. :) Sorry!

2009/12/3 Dmitriy Igrishin <dmitigr@gmail.com>

> Hello all.
> Tom right. Encrypted MD5 passwords computed as md5(password || test10). I
> checked.
>
> Regards, Dmitriy Igrishin.
>
> 2009/12/3 Tom Lane <tgl@sss.pgh.pa.us>
>
> Gerardo Herzig <gherzig@fmed.uba.ar> writes:
>> > Hi all. Im triyng, with no success, to create a user, and set the
>> > password with a md5 string.
>>
>> The correct method for computing the md5'd password includes the
>> username.  I think it's 'md5' || md5sum(password || username)
>> but look at the code or docs.
>>
>>                        regards, tom lane
>>
>> --
>> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
>> To make changes to your subscription:
>> http://www.postgresql.org/mailpref/pgsql-sql
>>
>
>

^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2009-12-03 19:38 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2009-12-03 18:05 create user xxx with md5 string? Gerardo Herzig <gherzig@fmed.uba.ar>
2009-12-03 19:21 ` Tom Lane <tgl@sss.pgh.pa.us>
2009-12-03 19:02   ` Gerardo Herzig <gherzig@fmed.uba.ar>
2009-12-03 19:36   ` Dmitriy Igrishin <dmitigr@gmail.com>
2009-12-03 19:38     ` Dmitriy Igrishin <dmitigr@gmail.com>

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