From 3c58b5beae7e41793f558482836bc5ccff983274 Mon Sep 17 00:00:00 2001 From: Joe Tingsanchali Date: Wed, 23 Mar 2022 20:42:05 -0500 Subject: [PATCH] SONAR-16186 DOCS distinguish SQL query for resetting admin password for Oracle, PostgreSQL, and MS SQL Server database engines (cherry picked from commit 71518f610124e92315479e2e97af441d51773a28) --- .../pages/instance-administration/security.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/server/sonar-docs/src/pages/instance-administration/security.md b/server/sonar-docs/src/pages/instance-administration/security.md index 7ccb7268b34..a0820bfdd27 100644 --- a/server/sonar-docs/src/pages/instance-administration/security.md +++ b/server/sonar-docs/src/pages/instance-administration/security.md @@ -92,10 +92,7 @@ When installing SonarQube, a default user with Administer System permission is c * Password: admin ## Reinstating Admin Access -If you changed and then lost the `admin` password, you can reset it using the following query: -``` -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'; -``` + If you've deleted `admin` and subsequently locked out the other users with global administrative permissions, you'll need to re-grant `admin` to a user with the following query: ``` INSERT INTO user_roles(uuid, user_uuid, role) @@ -104,6 +101,17 @@ VALUES ('random-uuid', 'admin'); ``` +If you changed and then lost the `admin` password, you can reset it using the following query, depending on the database engine: + +### 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'; +``` + ## Authorization The way authorization is implemented in SonarQube is pretty standard. It is possible to create as many users and groups of users as needed. The users can then be attached (or not) to (multiple) groups. Groups and/or users are then given (multiple) permissions. The permissions grant access to projects, services, and functionalities. -- 2.39.5