Jenkins忘记密码处理

1、先找到/var/lib/jenkins/config.xml文件,备份。

2、然后编辑,删除以下部分:

<useSecurity>true</useSecurity>

 <authorizationStrategyclass="hudson.security.FullControlOnceLoggedInAuthorizationStrategy">

   <denyAnonymousReadAccess>true</denyAnonymousReadAccess>

 </authorizationStrategy>

 <securityRealmclass="hudson.security.HudsonPrivateSecurityRealm">

   <disableSignup>true</disableSignup>

   <enableCaptcha>false</enableCaptcha>

 </securityRealm>

 

重启

[root@jenkins jenkins]# service jenkinsrestart

/bin/sh: warning: setlocale: LC_ALL: cannotchange locale (en_US.UTF-8)

Shutting down Jenkins [  OK  ]

Starting Jenkins [  OK  ]

3、登录jenkins—系统管理,允许用户注册


4、注册完成之后加入管理员


5、在重置管理员密码


6、恢复配置文件并重启

[root@jenkins jenkins]# cp config.xml.wolfconfig.xml

[root@jenkins jenkins]# service jenkinsrestart

/bin/sh: warning: setlocale: LC_ALL: cannotchange locale (en_US.UTF-8)

Shutting down Jenkins [  OK  ]

Starting Jenkins [  OK  ]

Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐