RecoverRootPassword

From Request Tracker Wiki
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, corrupt, or lose 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/rt4/local/lib -I/opt/rt4/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 switch to the RT Database.

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

For RT4 use the default enry (root/password):

mysql> UPDATE Users SET Password='!bcrypt!10!xijhhtbzipG6.EsQwgic7.D1mUs2tC0yN4iNjOWS9Za8gAtKTzTlW' 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';

Enable root user

Q: Passwort is reset, but i still can not log in. My log says:

Disabled user root tried to log in

A: You have to (re-)enable the root user:

Find out the id of root (usually it's 12):

mysql> SELECT * FROM Users WHERE Name='root';

Check if root is disabled:

mysql> SELECT * FROM Principals WHERE id=12;

Enable root:

mysql> UPDATE Principals SET Disabled=0 WHERE id=12;

See also

PasswordsInDB