jenkins forgot password problem solving

If we want to add a new user one day, add some plugins or something. And then found that our administrator password forgot what to do. Haha let me teach you how to solve it.

The following takes windos as an example. In fact, it is all the same to find the user's configuration file and then change the password.

Under windos, we can go to this directory by default: C:\Users\Administrator\.jenkins\users\admin

Under users you have several users then there will be several files named after the user.

So let's see what's in the admin file directory?

Then we can modify this confing.xml below.

First find the <passwordHash> tag in the file as shown in the figure

The label is our password, but this password is encrypted and we can't understand it. Fear not, we can modify it to

#jbcrypt:$2a$10$MiIVR0rr/UhQBqT.bBq0QehTiQVqgNpUGyWW2nJObaVAM/2xSQdSq

The above segment is encrypted with 123456

Then we save the file and log in with admin 123456 after opening jenkins.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326021837&siteId=291194637