How do I login to Jenkins when I locked myself out?

Article ID:206598218
1 minute readKnowledge base


  • When managing user permissions, a user might set a permission wrong and lose access when using their main administrator account. Regaining access can be done in a few steps.

  • global security needs to be changed, unable to login as administrator


1) Stop Jenkins

2) Edit the config.xml file in the JENKINS_HOME folder and locate this line:


Set the value to `false`

3) Start Jenkins

4) If you don’t know your admin password when using Jenkins’ own user database for your Security Realm, go to:


to set the new `admin` password.

5) Now go to Manage Jenkins -> Configure Global Security and choose your Security Realm and Authorization settings to re-enable security.

an alternative to step 2 is to restore a known good configuration of JENKINS_HOME/config.xml from a backup that was taken immediately before the Configure Global Security changes were done that caused the issue. We recommmend you do a diff of the current content of JENKINS_HOME/config.xml and the version from the backup before you replace it, to ensure you understand what you are reverting.