How to "Unlock Jenkins"?

Solution 1:

Starting from version 2.0 of Jenkins you may use

-Djenkins.install.runSetupWizard=false 

to prevent this screen.

Accroding to documentation

jenkins.install.runSetupWizard - Set to false to skip install wizard. Note that this leaves Jenkins unsecured by default. Development-mode only: Set to true to not skip showing the setup wizard during Jenkins development.

More details about Jenkins properties can be found on this Jenkins Wiki page.

Solution 2:

Check https://wiki.jenkins-ci.org/display/JENKINS/Logging to see where Jenkins is logging its files.

e.g. for Linux, use the command: less /var/log/jenkins/jenkins.log

And scroll down to the part: "Jenkins initial setup is required. An admin user has been created ... to proceed to installation:

[randompasswordhere] <--- Copy and paste

Linux

By default logs should be made available in /var/log/jenkins/jenkins.log, unless customized in /etc/default/jenkins (for *.deb) or via /etc/sysconfig/jenkins (for */rpm)

Windows

By default logs should be at %JENKINS_HOME%/jenkins.out and %JENKINS_HOME%/jenkins.err, unless customized in %JENKINS_HOME%/jenkins.xml

Mac OS X

Log files should be at /var/log/jenkins/jenkins.log, unless customized in org.jenkins-ci.plist

Solution 3:

  1. open file: e:\Program Files (x86)\Jenkins\secrets\initialAdminPassword
  2. copy content file: 47c5d4f760014e54a6bffc27bd95c077
  3. paste in input: http://localhost:8080/login?from=%2F

DONE

Solution 4:

Some of the above instructions seem to have gone out of date. As of the released version 2.0, creating the following file will cause Jenkins to skip the unlock screen:

${JENKINS_HOME}/jenkins.install.InstallUtil.lastExecVersion

This file must contain the string 2.0 without any line terminators. I'm not sure if this is required but Jenkins also sets the owner/group to be the same as the Jenkins server, so that's probably a good thing to mimic as well.

I did not need to create the upgraded or .last_exec_version files.

Solution 5:

I assume you were running jenkins.war manually with java -jar jenkins.war, then all logging information by default is output to standard out, just type the token to unlock jenkins2.0. enter image description here

If you were not running jenkins with java -jar jenkins.war, then you can always follow this Official Document to find the correct log location.