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>
  1. 重启systemctl restart jenkins

  2. 登录jenins 选择系统管理,打开全局安全设置

image-20200827160649353

​ 选择jenkins 专有用户数据库,点击保存

  1. 返回界面,选择管理用户,就会看到用户列表,在admin 右边点击进去

image-20200827160941338

  1. 这样就会在页面看到登录,点击登录

    image-20200827161055675

即可登录jenkins

comments powered by Disqus