pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
postgres user, forgotten password
3+ messages / 3 participants
[nested] [flat]

* postgres user, forgotten password
@ 2005-02-22 14:07 Zouari Fourat <fourat@gmail.com>
  2005-02-22 14:54 ` Re: postgres user, forgotten password Bruno Wolff III <bruno@wolff.to>
  2005-02-22 15:46 ` Re: postgres user, forgotten password Scott Marlowe <smarlowe@g2switchworks.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Zouari Fourat @ 2005-02-22 14:07 UTC (permalink / raw)
  To: pgsql-admin

Hello,
i forgot the postgres user password, how to resolve this problem.
once i have my postgres user working, how to list all users on the server ?
thanks a bunch



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

* Re: postgres user, forgotten password
  2005-02-22 14:07 postgres user, forgotten password Zouari Fourat <fourat@gmail.com>
@ 2005-02-22 14:54 ` Bruno Wolff III <bruno@wolff.to>
  1 sibling, 0 replies; 3+ messages in thread

From: Bruno Wolff III @ 2005-02-22 14:54 UTC (permalink / raw)
  To: Zouari Fourat <fourat@gmail.com>; +Cc: pgsql-admin

On Tue, Feb 22, 2005 at 15:07:45 +0100,
  Zouari Fourat <fourat@gmail.com> wrote:
> Hello,
> i forgot the postgres user password, how to resolve this problem.
> once i have my postgres user working, how to list all users on the server ?
> thanks a bunch

Edit pg_hba.conf to use trust or ident authentication for "postgres".
You probably want to make sure there is no external access to the database
while doing this.

SELECT usename FROM pg_user;



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

* Re: postgres user, forgotten password
  2005-02-22 14:07 postgres user, forgotten password Zouari Fourat <fourat@gmail.com>
@ 2005-02-22 15:46 ` Scott Marlowe <smarlowe@g2switchworks.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Scott Marlowe @ 2005-02-22 15:46 UTC (permalink / raw)
  To: Zouari Fourat <fourat@gmail.com>; +Cc: pgsql-admin

On Tue, 2005-02-22 at 08:07, Zouari Fourat wrote:
> Hello,
> i forgot the postgres user password, how to resolve this problem.
> once i have my postgres user working, how to list all users on the server ?
> thanks a bunch

First off, PostgreSQL stores passwords as md5 hashes (well, the last few
versions do anyway) so you won't be able to retrieve the password,
although a brute force md5 cracker might be able to eventually guess it
if it isn't too complex. 

However, the standard way I use for getting back in is:

edit pg_hba.conf and set it to have an entry for local all all trust at
the top.  restart postgresql.  Log in as postgres (psql template1 -U
postgres) change the postgres password.  Edit pg_hba.conf and get rid of
the trust line, restart postgres, psql template1 -U postgres to get back
in, and use select * from pg_shadow to see all the usernames.



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


end of thread, other threads:[~2005-02-22 15:46 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-22 14:07 postgres user, forgotten password Zouari Fourat <fourat@gmail.com>
2005-02-22 14:54 ` Bruno Wolff III <bruno@wolff.to>
2005-02-22 15:46 ` Scott Marlowe <smarlowe@g2switchworks.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