Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins login issue

Tags:

jenkins

ubuntu

Just setup jenkins on Ubuntu v16 laptop.

I have followed the installation steps from this page

After I setup, I fetched the setup password from /var/logs/jenkins/jenkins.log & was able to setup the admin user/password. I made a note of the creds.

I was also able to access & setup a simple helloworld pipeline job.

I stepped out and came back to my desk after about 20mins. The session has logged me out & I am not able to log-in with the creds. I have tried removing jenkins & setting it back. It still seems to retain the creds somewhere & now I am getting to the login page with bad credentials error everytime.

Invalid login information. Please try again. 
Try again
If you are a system administrator and suspect this to be a configuration problem, see the server console output for more details.

Need help figuring out what is happening. My logs have no useful information related to this error.

like image 631
sudhishkr Avatar asked Jul 10 '16 21:07

sudhishkr


2 Answers

As stated in this answer, the quickest way to get around this would be to disable security altogether by making the following change to your Jenkins config.xml file:

<useSecurity>true</useSecurity>

After rebooting your Jenkins instance, you should be able to return to the admin page and set everything up from there.

An alternate solution to this is mentioned here, which should accomplish what you want whereby preserving the security of your Jenkins instance (thus making this a more ideal solution). You would instead update the passwordHash section of your Jenkins config.xml file:

<passwordHash>#jbcrypt:$2a$10$razd3L1aXndFfBNHO95aj.IVrFydsxkcQCcLmujmFQzll3hcUrY7S</passwordHash>

The passwordHash section of the config.xml file is a child tag under <hudson.security.HudsonPrivateSecurityRealm_-Details>.

You would again need to reboot Jenkins once this change has been made, and you would login using the password 'test'. Of course, you could provide your own hash of a different password which would be advisable.

like image 185
lax1089 Avatar answered Sep 18 '22 16:09

lax1089


In Windows the initial password can be found in the below location:-

C:\Program Files(x86)\Jenkins\secrets\initialAdminPassword

try this method

like image 25
dasunse Avatar answered Sep 21 '22 16:09

dasunse