Jenkins 忘记密码
jenkins 忘记密码
找到config.xml 文件并且备份
find / -name config.xml
/var/lib/jenkins/config.xml
cp /var/lib/jenkins/config.xml /var/lib/jenkins/config.xml.bak
vim /var/lib/jenkins/config.xml
删除以下安全模块
<useSecurity>true</useSecurity>
<authorizationStrategy class="hudson.security.FullControlOnceLoggedInAuthorizationStrategy">
<denyAnonymousReadAccess>true</denyAnonymousReadAccess>
</authorizationStrategy>
<securityRealm class="hudson.security.HudsonPrivateSecurityRealm">
<disableSignup>true</disableSignup>
<enableCaptcha>false</enableCaptcha>
</securityRealm>
-
重启systemctl restart jenkins
-
登录jenins 选择系统管理,打开全局安全设置
选择jenkins 专有用户数据库,点击保存
- 返回界面,选择管理用户,就会看到用户列表,在admin 右边点击进去
-
这样就会在页面看到登录,点击登录
即可登录jenkins