Recover Lost Admin Password in Jenkins
Jenkins is an open-source automation server which is used to automate tasks like building the project, deploying. I am using Jenkins for building .Net projects and then deploying it on to the Dev, Stage and Prod Server. Creating a Job in Jenkins means creating Pipeline (Jenkins Pipeline) which is a combination of plugins used to create continuous flow of actions.
For Example : I will create a Jenkins Pipeline which will Build the .Net Project from Github and then deploy it to the Windows Server. For that I need to add a GitHub Plugin which will check if any new commits have been added or not, MSBuild plugin for building the .Net Project and the last is msdeploy for deploying the build to the server.
This is the small introduction of Jenkins and Jenkins Pipeline. So I am the admin of the jenkins server and we have Jenkins Security, so that I can only run the pipelines. But recently after updating my Windows from 7 to 10, I lost all my saved password. I know, I should have backed up.
Now I cannot login to Jenkins and they also do not have an option to Reset the password. So, the Only thing pending for me to update the Config File. I will show you the Step by Step process how I have recovered the password or better way to say How I managed to Login again to Jenkins Server.
Step 1 : You need to get an Admin Privilege for the Windows Server where you have hosted your Jenkins and login to the Server and go inside the Jenkins folder.
Step 2 : Then you need to Stop the Jenkins Service Using Command jenkins.exe stop
Step 3 : Open config.xml file and update useSecurity as false
.
Step 4 : Start Jenkins Service Using Command jenkins.exe start
.
Step 5 : Now from the website again create a new User having the Admin privilege.
These are the above steps to recover the account if you have lost the admin password, but I do recommend not to lose the password and take a back up of it.
Posted on Utopian.io - Rewarding Open Source Contributors