From: Scott Marlowe <smarlowe@g2switchworks.com>
To: Zouari Fourat <fourat@gmail.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: postgres user, forgotten password
Date: Tue, 22 Feb 2005 09:46:46 -0600
Message-ID: <1109087206.30529.83.camel@state.g2switchworks.com> (raw)
In-Reply-To: <621eda8a05022206077a5506c5@mail.gmail.com>
References: <621eda8a05022206077a5506c5@mail.gmail.com>
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.
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: smarlowe@g2switchworks.com, fourat@gmail.com
Subject: Re: postgres user, forgotten password
In-Reply-To: <1109087206.30529.83.camel@state.g2switchworks.com>
References: <621eda8a05022206077a5506c5@mail.gmail.com> <1109087206.30529.83.camel@state.g2switchworks.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
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