How to recover admin password for SonarQube

sonarqube

Solution

Just an update to this the new link is here:

https://docs.sonarqube.org/latest/instance-administration/security/#header-3

As it says on the link you can do this:

In case you lost the admin password of your SonarQube instance, you can reset it by executing the following query:

PostgreSQL and Microsoft SQL Server

update users set crypted_password='100000$t2h8AtNs1AlCHuLobDjHQTn9XppwTIx88UjqUm4s8RsfTuXQHSd/fpFexAnewwPsO6jGFQUv/24DnO55hY6Xew==', salt='k9x9eN127/3e/hf38iNiKwVfaVk=', hash_method='PBKDF2', reset_password='true', user_local='true' where login='admin';

Oracle

update users set crypted_password='100000$t2h8AtNs1AlCHuLobDjHQTn9XppwTIx88UjqUm4s8RsfTuXQHSd/fpFexAnewwPsO6jGFQUv/24DnO55hY6Xew==', salt='k9x9eN127/3e/hf38iNiKwVfaVk=', hash_method='PBKDF2', reset_password=1, user_local=1 where login='admin';

This will reset the password for admin user to admin.

Problem

I forgot the admin password for SonarQube. Googled and found that the value for `crypted_password` should be updated to `8b1254c1c684c5dc904f3f174cea1cacbde4ad84` which will reset the password to `admin`. But still I am not able to login. Any advice?

Original source