SonarQube 6.5 Resetting admin Password on CentOS7

Install pgAdmin on centos7 (GNOME environment) – yum install pgadmin4-desktop-gnome

check the config file of sonarqube – /opt/sonarqube/conf/sonar.properties
– sonar.jdbc.url=jdbc:postgresql://localhost/sonar
– sonar.jdbc.username=sonar
– sonar.jdbc.password=Password1

start pgAdmin by simply running “pgadmin4” command OR
Applications -> Programming -> pgAdmin 4

Under Quick links click Add New Server

Configure using the parameters you acquired from the properties file.
– Host name : localhost (assuming you have already logged into the sonar server)
– Enter username
– Enter the password
Click Save.

Now you have access to SonarQube database.

Go to:
Databases -> sonar, Schemas -> public, Tables -> users

Right click on users table. Select Scripts -> UPDATE script. Run the command below:
update users set crypted_password = ’88c991e39bb88b94178123a849606905ebf440f5′, salt= ‘6522f3c5007ae910ad690bb1bdbf264a34884c6d’ where login = ‘admin’

For newer versions of sonarqube you can use this:
update users set crypted_password = ‘$2a$12$uCkkXmhW5ThVK8mpBvnXOOJRLd64LJeHTeCkSuB3lfaR2N0AYBaSi’, salt=null, hash_method=’BCRYPT’ where login = ‘admin’

Check this out for the most recent reset command: https://docs.sonarqube.org/latest/instance-administration/security/

Now the admin password has been set to ‘admin’.

restart “sonar” service – systemctl restart sonar

Login with admin:admin.

 

Hope this helps.
Good Luck,
Serdar