2

I have installed Jenkins on an ec2 Ubuntu 18.04 LTS server based on these instructions: https://linuxize.com/post/how-to-install-jenkins-on-ubuntu-18-04/

When I go to Jenkins in my browser I get the "Unlock Jenkins" page:

Unlock Jenkins To ensure Jenkins is securely set up by the administrator, a password has been written to the log (not sure where to find it?) and this file on the server:

/var/lib/jenkins/secrets/initialAdminPassword

Please copy the password from either location and paste it below.

ERROR: The password entered is incorrect, please check the file for the correct password

But the folder /var/lib/jenkins/secrets/ does not contain the initialAdminPassword file.

I tried temporarily turning off security based on How to reset Jenkins security settings from the command line? but the "useSecurity" tag in config.xml gets reset to "true" every time I restart Jenkins.

I also tried this, but was still not able to find the password file Unlock Jenkins - how to

ohthepain
  • 2,004
  • 3
  • 19
  • 30
  • It looks like you entered a password. Which one did you use? Is there the password in the install log from apt? What files does `/var/lib/jenkins/secrets/` contain? – Wie May 17 '19 at 08:33
  • I didn't enter a password. Sorry, I don't know how to block quote from a response. The secrets folder contains: > filepath-filters.d > hudson.console.AnnotatedLargeText.consoleAnnotator > hudson.console.ConsoleNote.MAC > hudson.model.Job.serverCookie > hudson.util.Secret > jenkins.model.Jenkins.crumbSalt > master.key > org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.mac > org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY > slave-to-master-security-kill-switch > whitelisted-callables.d – ohthepain May 17 '19 at 09:28
  • Also, I should mention that there is no mention of a password in the jenkins logs – ohthepain May 17 '19 at 09:38

1 Answers1

0

You have forgotten to run

sudo apt-get update

before running

 sudo apt-get install jenkins

and because of that, your system repo could not got updated and hence you installed an earlier unpatched version.

so follow full procedure without skipping any steps:

wget -q -O - https://pkg.jenkins.io/debian/jenkins-ci.org.key | sudo apt-key add -
echo deb https://pkg.jenkins.io/debian-stable binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list
sudo apt-get update
sudo apt-get install jenkins
Hritik Kumar
  • 89
  • 2
  • 6