Reset Jenkins Password

Reset Jenkins Password

Issue fixed - Jenkins

·

2 min read

What is Jenkins?

Jenkins is a free and open-source automation server. It helps automate the parts of software development related to building, testing, and deploying, facilitating continuous integration and continuous delivery.

How to Reset Forgotten Jenkins Admin User's Password

The simplest solution is to altogether disable security in /var/lib/jenkins/config.xml file or User home directory

  1. Connect with ssh to your Jenkins server.

  2. Let's see the config.xml file

Important: You will see a config.xml file, you have to make a copy of a Jenkins config file.

Make a backup copy of a Jenkins config file.

Open the config file .jenkins/config.xml to disable the security

Modify the value between the <useSecurity> tags and set the value to false

Already here useSecurity TRUE

<useSecurity>true</useSecurity>

Will be changed to "false"

<useSecurity>false</useSecurity> Save the changes

Restart the Jenkins Service

brew services restart jenkins-lts

After restarting you can check the Jenkins service is running with brew services info jenkins-lts command

Go to the Jenkins UI, won’t be asked for any credentials this time because you will be logged in as an anonymous user to the Jenkins.

First, you check which user login the Jenkins there is no user name. So if you reset your password.

Navigate to "Manage Jenkins" -> "Security" -> "Configure Global Security" -> "Authentication"

Select the "Security Realm" (e.g. "Jenkins’ own user database") and click on "Save"

Go to "Dashboard"->"People" -> Click on a username for which you want to change the password (e.g. admin) -> "Configure" -> Enter a new password in the "Password" and "Confirm password" fields and click on "Save"

Finally, change a password

Finally, Check the Jenkins login User