How to unlock jenkins on windows 10

I installed jenkins on my window 10 using msi, which I downloaded. It installed perfectly and now launched a browser in which I was asked to unlock jenkins using initialadminpassword. I can not find this file anywhere. I looked into the installation directory C: \ Program Files (x86) \ Jenkins, and I checked the log files and the password was not written to it. I even searched all over my C: for initialadminpassword and nothing came of it. I have a secret.key file in my Jenkins installation directory, but the key in this file does not work. Any ideas on how I can get around this would be very helpful.

thanks

+8
jenkins
source share
2 answers

The Jenkins Home directory should have a secrets subfolder. This directory should have a file named initialAdminPassword (without extension).

This file contains the password to which it refers.

+5
source share

In addition to How to unlock Jenkins? I am using a groovy script to ensure that an administrator account has been created.

It means:

  • I will copy the groovy script in <Jenkins>/ref/init.groovy.d/security.groovy
  • I run jenkins.war with -Djenkins.install.runSetupWizard=false

In this script, replace the file path with the username / password along the Windows path:

 def user = new File("/run/secrets/jenkins-adm-name").text.trim() def pass = new File("/run/secrets/jenkins-adm-pass").text.trim() 

Thus:

  • no wizard
  • one admin account with username / password of my choice.
+1
source share

All Articles