Review:
I forgot the Jenkins password I set at that time because I changed my computer, how do I reset my Jenkins account password?
Environment: Windows 10 64-bit system, Jenkins 2.249.3
First, find the application directory of the jenkins service, open the Jenkins.wrapper.log log file, and view the detailed INFO logs, as shown below:
Check out the startup configuration for Jenkins as follows:
2021-03-30 13:30:23,877 INFO - Starting C:\Java\jdk1.8.0_211\bin\java.exe -Xrs -Xmx256m -Dhudson.lifecycle=hudson.lifecycle.WindowsServiceLifecycle -jar "C:\Program Files\ Jenkins\jenkins.war" --httpPort=8080 --webroot="C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\war" The webroot directory is: C:\Windows\system32\config\systemprofile\AppData\Local\Jenkins\war, so we open his parent directory and go to the .jenkins folder.
Path: C:\Windows\System32\config\systemprofile\AppData\Local\Jenkins\.jenkins, open the config.xml configuration file, as shown below:
willuseSecuritySet to false, as follows:
Restart the Jenkins service. Reopen the Jenkins website, and at this time, we will enter the system directly without a password, as shown in the figure below:
Click Manage Jenkins and find on the right: Insecure Jenkins allows anyone on the network to access the program as you. Consider at least enabling authentication to stop abuse. , selectSecurity settings, as shown in the figure below:
Select "Jenkins own user databaseAs shown below:
After saving,The program automatically modifies the config.xml profileto set useSecurity to true.
Click on the list of users, as follows:
Click on the user ID, select Settings, and find the password settings, as shown in the figure below:
After resetting the password, click Save.
Finally, find manage jenkins -> Configure Global Security, [Access Control] -[Authorization Policy], set "Logged-in users can do anythingOnly logged-in users can access and view, as shown in the figure below:
Restarting Jenkins Service (End)
|