Unix Technical Forum

postgres user, forgotten password

This is a discussion on postgres user, forgotten password within the pgsql Admins forums, part of the PostgreSQL category; --> Hello, i forgot the postgres user password, how to resolve this problem. once i have my postgres user working, ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > pgsql Admins

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-10-2008, 01:25 AM
Zouari Fourat
 
Posts: n/a
Default postgres user, forgotten password

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

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-10-2008, 01:25 AM
Bruno Wolff III
 
Posts: n/a
Default Re: postgres user, forgotten password

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;

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-10-2008, 01:25 AM
Scott Marlowe
 
Posts: n/a
Default Re: postgres user, forgotten password

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.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:21 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
www.UnixAdminTalk.com