Quick HOWTO: Reset Jenkins Admin Password

To reset the jenkins admin password, You can simply disable the security in the config.xml file.

1. If your jenkins is running on the Linux OS, edit the below file.

vi /var/lib/jenkins/config.xml file.

2. Search for the word <useSecurity>true</useSecurity>
and change the word true to false

3. Restart the Jenkins server.
service jenkins restart

4. Now go to the Jenkins portal again and Jenkins will not ask any credentials this time. You navigate to "Manage Jenkins" to set the administrator password again.

5. Enable the security again by changing settings to <useSecurity>true</useSecurity> and restart the Jenkins again.

Note: 

If your jenkins is running on Windows OS, config.xml file located in C:\Program Files (x86)\Jenkis\ folder.


Share this

Related Posts

Previous
Next Post »

7 comments

Write comments
Anonymous
March 15, 2019 at 11:42 PM delete

The only thing I need to figure out it step 4. If I go to the Jenkins portal without security enabled, it just lets me in. If I go with security enabled, I can't login as admin because it's claiming the password is wrong, and there's no password reset option.

Reply
avatar
Anonymous
October 31, 2019 at 7:44 PM delete

Hey dipshit you left out the most important part. What steps to take in the console to reset the password...

Reply
avatar
Anonymous
July 26, 2020 at 4:41 AM delete

if you are running jenkins with: java -jar jenkins.war
you will find the config file in /root/.jenkins

Reply
avatar
September 24, 2020 at 3:33 PM delete

It works so perfectly, thanks very much.

Reply
avatar

What do you think about this Article? Add your Opinion..! EmoticonEmoticon