0

Unable to login to jenkins even if we enter valid credential

login-jenkins-failed

NearHuscarl
  • 66,950
  • 18
  • 261
  • 230
BibhuTest
  • 21
  • 1
  • 1
  • 1

6 Answers6

4

You can change the password by manually editing the configuration file for your user. (/jenkins/users/username/config.xml) and update the contents of passwordHash:

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

Restart Jenkins and login using below password:

test

Have a look at below thread: Reset Jenkins Configuration Command Line

Krishan Kant
  • 175
  • 2
  • 9
0

With the limited information you have provided, i think you were pressing wrong credentials. However, i know of 2 options to fix this : 1) Go to your Jenkins installation Directory (Usually C:\Users\<UserID>\.jenkins\), look for config.xml - Check for below xml tags useSecurity authorizationStrategy. You can play around with the values to get anonymous access/allow signup etc.. 2) Re-install the jenkins itself - Remember to backup your jobs/workspace if you have already coded some jobs.

0

In case , you are installing as Jenkins as a 'Windows service' , then you can use username: admin & initial password: 'provided while installing Jenkins' to log in.

0

In addition to this answer, I had to do restart the Jenkins service for the change to take effect:

Go to the config folder (seems to be in one of the following for different versions):

# Windows (my machine)
C:\Users\<user>\AppData\Local\Jenkins\.jenkins\users\<jenkins username>_<random numbers>\config.xml 

# Windows (Other)
C:\ProgramData\Jenkins\.jenkins\config.xml

# Linux 
/jenkins/users/username/config.xml

# (Others?...)

Change contents of passwordHash tag for this:

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

Restart Jenkins service:

# Windows
# (Inside Jenkins folder: C:\Program Files\Jenkins)
jenkins.exe restart

# Linux
sudo service jenkins restart

Login using your username and the password:

test
Bersan
  • 1,032
  • 1
  • 17
  • 28
0

In mycase after commenting or removing the below line, it worked!

  1. Goto: C:\ProgramData\Jenkins.jenkins\config.xml

  2. Remove the below line in config.xml: enter image description here

Danu Sha
  • 1
  • 1
0

While solving same issue, I noticed there were two folders .Jenkins in my system. That's why attempts to change config.xml failed for me. For version 2.401.2 it was ProgramData\Jenkins\.Jenkins (not that one in {your_user} folder). Hope this saves somebody's time

Tetiana QA
  • 11
  • 2