Jenkins 忘记密码后重置或找回密码 🔗
方法1 🔗
找到jenkins
home目录中的config.xml
把其中
1
| <useSecurity>false</useSecurity>
|
false
改为 true
家目录正常在
- /var/lib/jenkins
- ~/.jenkins
- /var/jenkins_home
方法2 🔗
输出的就是密码
1
| cat /var/lib/jenkins/secrects/initialAdminPassword
|
方法3 🔗
1
| cd /var/lib/jenkins/users/admin_xxxxxx
|
替换其中
1
| <passwordHash>#jbcrypt:$2a$10$F3FuCma14yxF5zVAxelffez7oZoCZzW5Iau/LS5DIvmzugazYZSSS</passwordHash>
|
为
1
| <passwordHash>#jbcrypt:$2a$10$4NW.9hNVyltZlHzrNOOjlOgfGrGUkZEpBfhkaUrb7ODQKBVmKRcmK</passwordHash>
|
新密码为123456
方法4 🔗
1
2
3
4
5
6
7
8
| <useSecurity>true</useSecurity>
<authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy">
<denyAnonymousReadAccess>true</denyAnonymousReadAccess>
</authorizationStrategy>
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
<disableSignup>true</disableSignup>
<enableCaptcha>false</enableCaptcha>
</securityRealm>
|
设置后重新注册新用户
重新改回config.xml
重启