Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»DevOps»How to Reset Jenkins Admin User Password

    How to Reset Jenkins Admin User Password

    By RahulDecember 15, 20203 Mins ReadUpdated:December 24, 2022

    Jenkins is a popular open-source automation server that is widely used for continuous integration and continuous delivery (CI/CD) in software development. As a system administrator, you may need to reset the Jenkins admin password if you have lost or forgotten it.

    Advertisement

    In this tutorial, we will learn how to reset the Jenkins admin password in a few simple steps.

    Steps to Reset Jenkins Admin Password

    Follow the below steps to recover admin account access to the Jenkins portal.

    1. Disable Current Security – First of all, login to your Jenkins server and edit the Jenkins configuration file (/var/lib/jenkins/config.xml) in your favorite text editor:
      sudo vim /var/lib/jenkins/config.xml 
      

      Disable the security by changing the `useSecurity` tag value to “false”.

      jenkins usersecurity to false

      Save your file and close it. The vim users press the `ESC` button then type `:wq!` and hit Enter to save the file.

    2. Apply Changes – Restart Jenkins service to apply the changes.
      sudo systemctl restart jenkins 
      

      After restarting make sure the Jenkins service is running with `sudo systemctl status jenkins` command.

    3. Access Jenkins as Anonymous User – Again access Jenkins in a web browser, It will redirect you to the dashboard without prompting for authentication. You will be logged in as an anonymous user to Jenkins.
    4. Under the Dashboard, go to the `People` option as seen in below image:
      How to Reset Jenkins Admin Password
      Click “People” button
    5. Delete Admin Account – Select the Admin user account to delete. Then click the "Delete" button to detele the selected account:
      How to Reset Jenkins Admin Password
      Delete admin account

      Click "Yes" to confirm the account deletion.

      Jenkins Reset Admin User Password
      Confirm delete account
    6. Enable Security Again – Now once you deleted old admin user. To reset all security options, go to the “Jenkins” -> “Manage Jenkins” option in left-hand side option lists. Now click on the “Configure Global Security” option
      How to Reset Jenkins Admin User Password
      Go to Global Security Option.

      You will see all option as bellow, do all below mentioned changes on this page

      • Enable the “Enable Security” option.
      • In Security Realm option select “Jenkins own database”
      • Make sure to uncheck the “Allow users to sign up” option under the “Jenkins own database” option.
      • Jenkin Reset Admin Password
        Select “Jenkin’s own user database”

        And

        Reset Jenkins Admin Account Password
        Logged in users can do anything
    7. Save Changes – Save all changes made above.
    8. Create Admin Account – You will be redirected to “Create First Admin User”. Input all required details to create a new Admin account.

      Create a New Admin User in Jenkins
      Create a New Admin User in Jenkins
    9. Login as New Admin User – Now, you can access your Jenkins dashboard using the newly created Admin account.

      Login Jenkins Admin Dashboard
      Login Jenkins Admin Dashboard
    10. All Done

    Conclusion

    In this tutorial, we learned how to reset the Jenkins admin password in a few simple steps. We hope that this tutorial has helped you understand how to reset the Jenkins admin password and that you are now able to access your Jenkins instance. If you have any questions or need further assistance, please don’t hesitate to ask.

    admin Jenkins password
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp

    Related Posts

    How to Generate Random Passwords in Python

    How to Generate Random Password in Python

    Force User to Change Password at Next Login

    How to Force User to Change Password at Next Login in Linux

    How To Change User Password in Windows Server 2019

    View 2 Comments

    2 Comments

    1. Prabhat on December 23, 2022 1:53 pm

      Hi Team
      this document is good, but you made one error you have written ‘userSecurity’ but is it useSecurity. Which is correctly showing in screenshot. If possible, get this change

      Reply
      • Rahul on December 24, 2022 2:42 am

        Thanks Prabhat, It’s corrected.

        Reply

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Error: EACCES: permission denied, scandir (Resolved)
    • How To Install Python 3.11 on Ubuntu 22.04 / 20.04
    • How to Install Python 3.11 on Amazon Linux 2
    • An Introduction to the “./configure” Command: Compiling Source Code in Linux
    • How to Install PHP 8.x on Pop!_OS
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.