How to Reset The Admin Password in Jenkins Tool on Linux
As a human generally its possible to forgot the password, so in this post will walk through you how to reset or create a new Jenkins Admin password in your Linux instance.
So far the Jenkins doesn't allow straight forward way to reset/update Admin user password. You need to login to the instance and create a new password for the Admin account.
Follow the below steps to reset/update admin password access the Jenkins consolw window,
Disable Jenkins Security:
We have to modify the security context of the Jenkins configuration, that is completely disable security in config.xml file. Login to your Jenkins server through the SSH connection, after loggedin open the Jenkins configuration using any text editior and the file format in XML. Here will use vim/vi text editor,
sudo vim /var/lib/jenkins/config.xml
Save the configured file (:wq!) and restart the Jenkins service using the command below,
service jenkins restart
Reset the Jenkins Admin Password:
Now, start the steps to reset the password from the Jenkins console window, http://localhost:8080/
Access Jenkins as Anonymous User: just open again the above url on your browser the page goes to Jenkins console without asking any password, that You will be logged in a anonymous user to the Jenkins.
Next, click on "People" tag under the Dashboard window,
Click on Delete tag the user account,
Next, Navigate to Jenkins -> Mange Jenkins,
Click on Configure Global Security,
under the configure Global Security configuration settings,
Check the Enable Security check box
Under Security Realm, select Jenkins’ own user database
In the Authorization section, select Logged-in users can do anything
Unselect Allow anonymous read access.
Click Save to save your changes.
Create a new Jenkins Admin Account:
Once saved the configuration, the page will be redirected to "Create First Admin User" window, we have to gives Input all required details to create a new Admin account.
Login with New Admin User:
Now, you are able to access the Jenkins with newly created admin account with password,