pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Fwd: resetting superuser password
5+ messages / 5 participants
[nested] [flat]

* Fwd: resetting superuser password
@ 2005-11-09 12:38  Marc A. Donis <mad7@runbox.com>
  0 siblings, 2 replies; 5+ messages in thread

From: Marc A. Donis @ 2005-11-09 12:38 UTC (permalink / raw)
  To: pgsql-admin

I have lost the superuser (user postgres) password, but I still have the unix root password.  Is there anything I can do to reset the postgres user's password (short of reinstalling Postgres)?

Obviously, I can su to unix user postgres, but this does not seem to advance my cause, as doing "psql -U postgres" still prompts me for a password, which is not the same as the unix postgres user's password. 

OS: RedHat 9

Help!

Thanks,
Marc



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

* Re: Fwd: resetting superuser password
@ 2005-11-09 12:44  Devrim GUNDUZ <devrim@gunduz.org>
  parent: Marc A. Donis <mad7@runbox.com>
  1 sibling, 1 reply; 5+ messages in thread

From: Devrim GUNDUZ @ 2005-11-09 12:44 UTC (permalink / raw)
  To: Marc A. Donis <mad7@runbox.com>; +Cc: pgsql-admin

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Hi,

On Wed, 9 Nov 2005, Marc A. Donis wrote:

> I have lost the superuser (user postgres) password, but I still have 
> the unix root password.  Is there anything I can do to reset the 
> postgres user's password (short of reinstalling Postgres)?

Edit pg_hba.conf and set the auth method to trust. Then reload postgresql. 
This will stop PostgreSQL from asking you a password.

Regards,
- --
Devrim GUNDUZ
Kivi Biliþim Teknolojileri - http://www.kivi.com.tr
devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr
                       http://www.gunduz.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDce8u4zE8DGqpiZARArkjAJ4jmuLYV6I3oLnTowbF3d0IOfDYTQCeKDqZ
je2SdfQvAxgOTUhirXlzq6A=
=8VN2
-----END PGP SIGNATURE-----
From pgsql-admin-owner@postgresql.org  Wed Nov  9 08:45:34 2005
X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org
Received: from localhost (av.hub.org [200.46.204.144])
	by svr1.postgresql.org (Postfix) with ESMTP id C1AB8D9B52
	for <pgsql-admin-postgresql.org@localhost.postgresql.org>; Wed,  9 Nov 2005 08:45:31 -0400 (AST)
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 24150-08
 for <pgsql-admin-postgresql.org@localhost.postgresql.org>;
 Wed,  9 Nov 2005 12:45:28 +0000 (GMT)
Received: from news.hub.org (news.hub.org [200.46.204.72])
	by svr1.postgresql.org (Postfix) with ESMTP id 5EB94D9B24
	for <pgsql-admin@postgresql.org>; Wed,  9 Nov 2005 08:45:30 -0400 (AST)
Received: from news.hub.org (news.hub.org [200.46.204.72])
	by news.hub.org (8.13.1/8.13.1) with ESMTP id jA9CjSJS029170
	for <pgsql-admin@postgresql.org>; Wed, 9 Nov 2005 12:45:28 GMT
	(envelope-from news@news.hub.org)
Received: (from news@localhost)
	by news.hub.org (8.13.1/8.13.1/Submit) id jA9Chsoc028631
	for pgsql-admin@postgresql.org; Wed, 9 Nov 2005 12:43:54 GMT
	(envelope-from news)
From: "mad" <mad7@runbox.com>
X-Newsgroups: pgsql.admin
Subject: resetting superuser password
Date: 9 Nov 2005 04:43:54 -0800
Organization: http://groups.google.com
Lines: 15
Message-ID: <1131540234.526161.161670@g43g2000cwa.googlegroups.com>
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-1"
X-Complaints-To: groups-abuse@google.com
User-Agent: G2/0.2
X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 Firefox/1.0.7,gzip(gfe),gzip(gfe)
X-HTTP-Via: 1.1 webproxy:8080 (squid/2.5.STABLE6)
Complaints-To: groups-abuse@google.com
Injection-Info: g43g2000cwa.googlegroups.com; posting-host=193.29.77.101;
   posting-account=Dt2P9g0AAADP8RcM2SpCaszJUO-a1x9F
To: pgsql-admin@postgresql.org
X-Virus-Scanned: by amavisd-new at hub.org
X-Spam-Status: No, score=-1.44 required=5 tests=[ALL_TRUSTED=-1.44]
X-Spam-Score: -1.44
X-Spam-Level: 
X-Archive-Number: 200511/86
X-Sequence-Number: 19459

I have lost the superuser (user postgres) password, but I still have
the unix root password. Is there anything I can do to reset the
postgres user's password (short of reinstalling Postgres)?

Obviously, I can su to unix user postgres, but this does not seem to
advance my cause, as doing "psql -U postgres" still prompts me for a
password, which is not the same as the unix postgres user's password.

OS: RedHat 9

Help!

Thanks,
Marc




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

* Re: Fwd: resetting superuser password
@ 2005-11-09 12:47  Martin Fandel <martin.fandel@alphyra-evs.de>
  parent: Marc A. Donis <mad7@runbox.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Martin Fandel @ 2005-11-09 12:47 UTC (permalink / raw)
  To: mad7@runbox.com; +Cc: pgsql-admin

Hi,

which version of postgres do you have? Put this temporarly into
the /var/lib/pgsql/data/pg_hba.conf:

if postgres 8:
local    all         postgres     127.0.0.1/32 trust

if postgres 7:
local      all         trust

then connect to template1...:
psql -U postgres -d template1

...and set your password:
 alter user postgres with encrypted password 'blablubb';

i hope this works.

regards,

martin

Am Mittwoch, den 09.11.2005, 13:38 +0100 schrieb Marc A. Donis:

> I have lost the superuser (user postgres) password, but I still have the unix root password.  Is there anything I can do to reset the postgres user's password (short of reinstalling Postgres)?
> 
> Obviously, I can su to unix user postgres, but this does not seem to advance my cause, as doing "psql -U postgres" still prompts me for a password, which is not the same as the unix postgres user's password. 
> 
> OS: RedHat 9
> 
> Help!
> 
> Thanks,
> Marc
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>                http://archives.postgresql.org

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

* Re: resetting superuser password
@ 2005-11-09 13:01  Stef <svb@ucs.co.za>
  0 siblings, 0 replies; 5+ messages in thread

From: Stef @ 2005-11-09 13:01 UTC (permalink / raw)
  To: mad <mad7@runbox.com>; +Cc: pgsql-admin

Just disable password checking in pg_hba.conf.

mad mentioned :
=> I have lost the superuser (user postgres) password, but I still have
=> the unix root password. Is there anything I can do to reset the
=> postgres user's password (short of reinstalling Postgres)?
=> 
=> Obviously, I can su to unix user postgres, but this does not seem to
=> advance my cause, as doing "psql -U postgres" still prompts me for a
=> password, which is not the same as the unix postgres user's password.
=> 
=> OS: RedHat 9
=> 
=> Help!
=> 
=> Thanks,
=> Marc
=> 
=> 
=> ---------------------------(end of broadcast)---------------------------
=> TIP 3: Have you checked our extensive FAQ?
=> 
=>                http://www.postgresql.org/docs/faq
=> 



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

* Re: Fwd: resetting superuser password
@ 2005-11-09 17:50  mad <mad7@runbox.com>
  parent: Devrim GUNDUZ <devrim@gunduz.org>
  0 siblings, 0 replies; 5+ messages in thread

From: mad @ 2005-11-09 17:50 UTC (permalink / raw)
  To: pgsql-admin

Thanks to all who replied, and all apologies for the multiple posting
(my fault).

The solution (in postgres 8.0.1):

Edit data/pg_hba.conf to contain the line:

local all postgres trust

Then su to unix user postgres and restart postges with:

> bin/pg_ctl restart -D /usr/local/pgsql/data -m fast

and finally, login to postgres with:

> psql -U postgres -d template1

and do

alter user postgres with encrypted password 'newpass';

Remove the line added to pg_hba.conf, and restart postgres again!
I'm a happy (and very relieved) camper.

Marc




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


end of thread, other threads:[~2005-11-09 17:50 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-11-09 12:38 Fwd: resetting superuser password Marc A. Donis <mad7@runbox.com>
2005-11-09 12:44 ` Devrim GUNDUZ <devrim@gunduz.org>
2005-11-09 17:50   ` mad <mad7@runbox.com>
2005-11-09 12:47 ` Martin Fandel <martin.fandel@alphyra-evs.de>
2005-11-09 13:01 Re: resetting superuser password Stef <svb@ucs.co.za>

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