RecoverRootPassword

From Request Tracker Wiki
Revision as of 06:57, 28 January 2011 by 80.152.160.53 (talk) (→‎SQL)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The topic of recovering root password comes up frequently in the MailingLists.

Here are some answers.

The original (default) RT root user password is "password", not the password you set in RT_SiteConfig.pm (which is your DBMS root user password), nor the password of your Unix root user.

If you over-write or corrupt the root password, there are a few ways to recover it.

Easiest way

Q: I lost the root password how can I reset it?

A:

perl -I/opt/rt3/local/lib -I/opt/rt3/lib \
    -MRT -MRT::User \
    -e'RT::LoadConfig();RT::Init(); my $u = RT::User->new($RT::SystemUser); $u->Load("root"); $u->SetPassword("secret")'



Use another known password

Use SQL to copy the known password from some other user into the root password.

Generate a new password

SQL

Use base64 encoded MD5 of the word 'password'. This should work with all recent RT versions. Before you set the password you must change to the RT Database.


mysql> UPDATE Users SET Password='X03MO1qnZdYdgyfeuILPmQ' WHERE Name='root';

Or...

mysql> UPDATE Users SET Password=md5('password') WHERE Name='root';

Or very old crypt variant.

mysql> UPDATE Users SET Password=ENCRYPT('password','SA') WHERE Name='root';

See also

PasswordsInDB