Wiki source code of Enable the Superadmin Account
Last modified by Eleni Cojocariu on 2026/10/02 13:51
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
![]() |
10.3 | 1 | ##superadmin## is a rescue account that bypasses the [[rights system>>doc:documentation.xs.admin.rights.rights-resolution.WebHome]] entirely. It is disabled by default, because a password left behind is a security hole, so enable it only to recover a wiki whose rights have become unusable. |
![]() |
4.1 | 2 | |
| 3 | 1. Stop the XWiki instance. | ||
| 4 | 1. Open ##xwiki/WEB-INF/xwiki.cfg##, uncomment the ##xwiki.superadminpassword## property and give it a password:((( | ||
| 5 | {{code language="none"}} | ||
| 6 | xwiki.superadminpassword=system | ||
| 7 | {{/code}} | ||
| 8 | ))) | ||
![]() |
10.1 | 9 | 1. ((( |
| 10 | {{version since="18.8.0RC1"}} | ||
| 11 | Replace that password with a hash of it, so that the configuration file no longer holds the password itself. Produce the hash, then write it after the key of the algorithm that produced it, between braces: | ||
| 12 | |||
| 13 | {{code language="bash"}} | ||
| 14 | htpasswd -bnBC 10 "" system | tr -d ':\n' | ||
| 15 | {{/code}} | ||
| 16 | |||
| 17 | {{code language="none"}} | ||
| 18 | pip install bcrypt | ||
| 19 | python -c "import bcrypt, getpass; print(bcrypt.hashpw(getpass.getpass().encode(), bcrypt.gensalt(rounds=10)).decode())" | ||
| 20 | {{/code}} | ||
| 21 | |||
| 22 | {{code language="none"}} | ||
| 23 | xwiki.superadminpassword={bcrypt}$2y$10$0RH05BOGfvbaI7ICDc/85OTECaD07U9ebVw.lYnNGCGC/v9UVT75. | ||
| 24 | {{/code}} | ||
| 25 | {{/version}} | ||
| 26 | ))) | ||
| 27 | 1. Restart the XWiki instance, then log in with ##superadmin## as the "Username" and the password you chose:((( | ||
![]() |
4.1 | 28 | {{image reference="superadmin-login.png" size="large" alt="The Log-in form with superadmin entered in the Username field"/}} |
| 29 | ))) | ||
| 30 | 1. Open the drawer and check that ##superadmin## is the current user:((( | ||
![]() |
9.1 | 31 | {{image reference="superadmin-logged.png" size="medium" alt="The drawer showing superadmin as the current user"/}} |
![]() |
4.1 | 32 | ))) |

