Reset the Jenkins administrator password

As a system administrator, you can reset the Jenkins admin password. In case you have forgotten or lost the password, this page provides instructions on how you can reset the admin password.

Reset the administrator password

  1. Log in to your Jenkins controller.

  2. Stop the Jenkins process. You may use this command: systemctl stop jenkins.

  3. Edit the Jenkins configuration file (config.xml) inside your jenkins/ or $JENKINS_HOME directory.

  4. Look for useSecurity and change it from true to false manually.

  5. Save your file and close it.

  6. Restart the Jenkins service to apply your changes. You may use this command: systemctl start jenkins. After restarting Jenkins, navigate to your controller and sign in.

  7. On the dashboard, select Manage Jenkins in the navigation pane on the left side of the page.

  8. On the Manage Jenkins page, under the Security section, select Configure Global Security.

  9. Under Security Realm, select Jenkins' own user database from the dropdown menu. Ensure the option Allow users to sign up is unchecked and save your changes. This redirects you to the Manage Jenkins page.

  10. On the Manage Jenkins page, select Users.

  11. You will see a list showing User IDs. Select the User ID that you want to change the password for.

  12. Select Configure using the gear icon or the dropdown menu from the User ID. Locate the Password section to change your password.

After changing the password, you will be able to log into your Jenkins instance again using the same username and the new password that you have just set.

Please ensure not to leave the Jenkins controller insecure. So, please re-enable the security by following these steps.

Enable security

  1. Log in as your admin account.

  2. On the dashboard, select Manage Jenkins in the navigation pane on the left side of the page.

  3. On the Manage Jenkins page, under the Security section, select Configure Global Security.

  4. Set the Authorization to Logged-in users can do anything. Uncheck the option Allow anonymous read access. Select Save.



Was this page helpful?

Please submit your feedback about this page through this quick form.

Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

    


See existing feedback here.