How To Reset Forgotten User ID and Password Of Jenkins

Prerequisite: you should be able to ssh your Jenkins server.

I have lost my user ID and pwd of Jenkins server.

#1. SSH your Jenkins server using the command line interface, Jenkins's default installation directory in Linux and Windows is as follows.

  • Linux: /var/lib/Jenkins

  • Windows: C:\Program Files (x86)\Jenkins

#2 Navigate to this folder and search for a file colled config.xml, this is the file which contains information about the Password and user name, we just have to look for the entry in correct tag only.

#3 open config.xml in any editor you want and locate one tag called, it will be true by default, change it to false, save it, in give ‘false’

# 4 Start the Jenkins server again (systemctl start jenkins), and oepen the interface in browser using, instance PublicIP:8080, after this change Jenkins will allow one option to sign up.

#5 Create a new administrator user: On the Jenkins web interface, click on the "Sign up" or "Create an account" link. Fill in the required details, including the username and password for the new administrator user.

Log in with the new credentials: Use the newly created username and password to log in

Thank you !

Stay Safe, Be Happy.