Jenkins — Reset Global Authentication (use own use database)

You may have authentication in Jenkins server for example, user name and password based on login mechanism.

What happens if you lost your admin credentials?

or lets take a scenario (which I faced), I enabled git-hub based login mechanism and lost our control our Jenkins authentication. No one could not login with admin credentials in Jenkins UI (browser) since it was routing to git-hub url for login and which resulted in 404 page.

How did I resolve this issue?

Firstly, I tried deleting the plugin (github-login) used for enabling the login in jenkins, it didnt work out for me. Then my ultimate aim was to disable to authentication mechanism and access the jenkins in web browser. Then delete the plugin and bring back the user based authentication mechanism.

The step that helped

Logged in to the jenkins server machine, navigated to var/jenkins_home and you will find config.xml. To be safe, I took a copy of that file, cp config.xml config_backup.xml.

If you look at the config.xml, you will find <useSecurity>true</useSecurity> if you have enabled authentication. I replaced this to false like shown here. Restart the jenkin server (mine is running in docker).

After restart, you wont have any login mechanism, jenkins is open. You can access manage jenkins section, go the installed plugin section, remove authentication plugin (in my case, I used github-login), create a new user if you want, enable the authentication back.

This will make your jenkin again use security, but this time, user name and password based login. And happy part it that you have credentials.

If you look the config.xml file now, you will see that <useSecurity>true</useSecurity>.

It was a time saving solution, I was able to bring back jenkins with security.

Burn More, Learn More!!




Front End Engineer | Netherlands. They say being human means having doubts yet still continuing on your path, so as I am.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Anypoint MQ Connector

If I Had to Start Over as a Developer — Pt 2

5 Bad Testing Practices Seasoned Java Developers Don’t Like to See

Jenkins + k8s: Building Docker Image without Docker

How I ended up at a new Leroy Merlin Store opening in Almaty, Kazakhstan

Professional transition from academia: Part I. From Ph.D. to coding

Speed Up your iOS Development: The Modules’s Paradigm

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Santhoshkumar Ravi

Santhoshkumar Ravi

Front End Engineer | Netherlands. They say being human means having doubts yet still continuing on your path, so as I am.

More from Medium

Amazon S3 Storage Classes

Jenkins : An Open source Automation Server

Setup Jenkins CI/CD pipeline to deploy Node.js to AWS EC2 [Part 2]

Configure a local Jenkins instance