How to upgrade Jenkins and Reset Admin Password
Posted By : Shubham Kamboj | 04-Jan-2021
How to upgrade Jenkins & reset password
Jenkins is a free open source continuous integration and continuous delivery tool. It used to automate the deployment process, software development related to building and testing. We can run jenkins on a container or on a server(Window/Linux). Jenkins supports many version control tools such as Git, CVS, apache maven, Subversion etc.
Benefits to upgrade Jenkins version
There are many benefits to upgrade jenkins version:-
- In the latest version of jenkins we are getting the upgrade version of plugins.
- Latest version removes page generation timestamp from the footer.
- It allow users with Overall/Manage permission to configure Node Monitoring and to reload configuration from disk
- It support Bearer tokens in Jenkins-CLI -auth parameter
- Fixed all the bugs related to plugins.
Also Read: SonarQube integration with Jenkins
Steps to upgrade Jenkins version
It is critical to keep your Jenkins up-to-date when you are using it in the production environment. So we need to keep a few things in mind that we have backup of all the things
To identify which Jenkins Version we have to upgrade just simply login to the Jenkins server, click on ‘Manage Jenkins' menu item, it will display the following message at the top: New version of Jenkins is available for download as shown below.
So now we find that we have to upgrade our jenkins version to 2.9 version.
The first step is we have to to download the war file by running command
cd ~/
wget http://updates.jenkins-ci.org/download/war/2.9/jenkins.war
Now we have to replace this jenkins.war file with the old version of jenkins and the path where we have to replace it in /usr/lib/jenkins directory.
Before replacing this new war file we have to take backup of the existing version of jenkins war file.
cp /usr/lib/jenkins/jenkins.war ~/jenkins.war.old.version
Then run, cp ~/jenkins.war /usr/lib/jenkins/
Also Read: How To Create A Custom Cache Server Using Nginx
After this restart the jenkins server
- systemctl stop jenkins
- systemctl start jenkins
After this process to verify the version just login to the jenkins server and click on ‘Manage Jenkins'. And, we’ll not see that upgrade available message anymore.
Reset Jenkins Password
- In case we have forgotten the jenkins password then We have to locate the config.xml in the /var/lib/jenkins/ directory.
- Then replace the value true to false in config.xml file
- <useSecurity>false</useSecurity>
save this file and then restart the jenkins server
sudo service jenkins restart
After that just login to the jenkins server it will not ask you the username and password to login on that.
- Click on People on the left-hand navigation menu.
- Click on the Admin.
- Delete the user account.
- And then create a new admin user
Also, Read AWS Application Load Balancer Vs. NGINX Plus!
We can also reset it without disabling security if you're using matrix permissions
- In config.xml, set disableSignup to false.
- Restart Jenkins.
- Open the Jenkins web page and sign up with a new user.
- In config.xml, duplicate one of the <permission>hudson.model.Hudson.Administer:username</permission> lines and replace username with the new user.
- If this is a private server, set disableSignup back to true in config.xml.
- Restart Jenkins.
- Go to the Jenkins web page and log in as the new user.
- Reset the password of the original user.
- Log in as the original user.
Choose Oodles For 360-degree SaaS App Development Services
We are a 360-degree software development company that provides complete web and mobile app development solutions for varied project requirements. Our end-to-end SaaS app development services address your mission-critical project requirements through scalable, responsive, and feature-rich software applications that are easy to scale. We carefully analyze your project requirements and formulate effective strategies to build enterprise-grade web and mobile applications for multiple platforms. For more info, contact us at [email protected].
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Shubham Kamboj
Shubham is a RHCE Certified Engineer who is having 2 years of experience in Linux and Cloud. He is a quick and active learner.