Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins Security - Unable to login

Tags:

jenkins

I enabled security on Jenkins and added myself as the only user. After clicking on "Save" it brought me back to the log-on screen without asking me to create a password. Now I can not log-in with the username I just added. Is there a default password that I can use or do I have to disable security again in the config.xml file?

Thanks for any help :)

like image 666
Johann Avatar asked Jun 19 '14 16:06

Johann


People also ask

How do I fix Jenkins login error?

Add users on the "Manage users" and then go back to "Manage security" then disable "Allow users to sign up". Also, you can now use Matrix based authentication without having to worry about getting locked out of Jenkins.


4 Answers

I solved it. Here's what I did.

  1. I disabled security in JENKINS_HOME/config.xml

  2. Restarted Tomcat

  3. I re-enabled security

  4. Selected Jenkin's own database and also checked Allow users to Sign-up (Also make sure that in Authorization, "Anyone can do anything" is ticked.)

  5. "Save". After clicking Save, it will bring you to the initial page, then on the top-right corner there is a "Sign up" link.

  6. Click on "Sign up", enter your username and password then log-in. Right now you are the only registered user. But it actually did something else. Prior to the creation of your first account, there is no "Manage users" in the "Manage Jenkins" menu. I saw this guide on adding users to Jenkins and it says that there should be a "Manage users" link under the "Manage Jenkins" menu but there is none. But after you have created your first account (using Sign up), you can now find it there.

  7. Add users on the "Manage users" and then go back to "Manage security" then disable "Allow users to sign up". Also, you can now use Matrix based authentication without having to worry about getting locked out of Jenkins.

I hope someone can find this useful.

Cheers.

like image 106
Johann Avatar answered Oct 08 '22 07:10

Johann


  1. http://localhost:8080/
  2. Put admin as user and admin password as a password, your admin password is the one you got while installing jenkins. In-case you forgot your admin password:

    Goto-> `/Users/{your
    username}/.jenkins/secrets/initialAdminPassword`
    
like image 29
Zubair Rehman Avatar answered Oct 08 '22 07:10

Zubair Rehman


When u download the .msi file, we have issues with logging in. The password cannot be found at the location /jenkins/secrets/initialAdminPassword. So it is advisible to download the generic java package (.war file) from https://jenkins.io/download/

Then go to the Jenkins location in the command prompt and execute the command "java -jar jenkins.war"

After few minutes, at the end of installation and initialization of Jenkins it gives a temporary password. Copy it and now you can access Jenkins at http://localhost:8080 and enter the temporary password

like image 35
randomguy Avatar answered Oct 08 '22 07:10

randomguy


Fine Jenkins_home open config.xml inside home directory. find useSecurity tag - and set it default. restart Jenkins. Open Jenkins (should take you inside with out a user name and password) -- go to manage jenkins -> Global Security -> Enable Sign up -> sign up a new user -> once user is sign up - login with that user and finally enable login and restart your jenkins.

like image 33
Pravin Bansal Avatar answered Oct 08 '22 07:10

Pravin Bansal