X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9D3608B9B74 for ; Tue, 22 Feb 2005 15:46:50 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 07120-06 for ; Tue, 22 Feb 2005 15:46:45 +0000 (GMT) Received: from koolancexeon.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by svr1.postgresql.org (Postfix) with ESMTP id 533778B9B69 for ; Tue, 22 Feb 2005 15:46:48 +0000 (GMT) Received: mail.g2switchworks.com 10.10.1.8 from 10.10.1.37 10.10.1.37 via HTTP with MS-WebStorage 6.5.6944 Received: from state.g2switchworks.com by mail.g2switchworks.com; 22 Feb 2005 09:46:46 -0600 Subject: Re: postgres user, forgotten password From: Scott Marlowe To: Zouari Fourat Cc: pgsql-admin@postgresql.org In-Reply-To: <621eda8a05022206077a5506c5@mail.gmail.com> References: <621eda8a05022206077a5506c5@mail.gmail.com> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1109087206.30529.83.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Tue, 22 Feb 2005 09:46:46 -0600 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200502/222 X-Sequence-Number: 16390 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.