首页 > 其他 > 详细

jenkins忘记密码了怎么办-jenkins找回密码

时间:2020-06-17 20:41:00      阅读:88      评论:0      收藏:0      [点我收藏+]

一段时间没登录jenkins,可能把密码忘记了,再登录时总是提示:登录信息无效。请重试。If you are a system administrator and suspect this to be a configuration problem, see the server console output for more details.应该是密码或者账号不对了。怎么找回密码呢,只能去配置文件中修改了

    首先找到jenkins的目录:-DJENKINS_HOME=/var/lib/jenkins

技术分享图片    此目录下会有一个users文件夹(jenkins/users/admin),存放着各登录用户的账号信息,一个用户账户一个文件夹。文件夹里有配置文件:config.xml,内容如下:

<?xml version=‘1.0‘ encoding=‘UTF-8‘?>
<user>
  <fullName>admin</fullName>
  <description>总管理员账号</description>
  <properties>
    <jenkins.security.ApiTokenProperty>
      <apiToken>rWArknUk9PnLS7riVJGISU/HFkjErmpNNNuiDC31aFd0SjdAh0ih3tN8GDkC94Nm</apiToken>
    </jenkins.security.ApiTokenProperty>
    <jenkins.security.LastGrantedAuthoritiesProperty>
      <roles>
        <string>authenticated</string>
      </roles>
      <timestamp>1475071638132</timestamp>
    </jenkins.security.LastGrantedAuthoritiesProperty>
    <hudson.model.MyViewsProperty>
      <primaryViewName></primaryViewName>
      <views>
        <hudson.model.AllView>
          <owner class="hudson.model.MyViewsProperty" reference="../../.."/>
          <name>All</name>
          <filterExecutors>false</filterExecutors>
          <filterQueue>false</filterQueue>
          <properties class="hudson.model.View$PropertyList"/>
        </hudson.model.AllView>
      </views>
    </hudson.model.MyViewsProperty>
    <hudson.model.PaneStatusProperties>
      <collapsed/>
    </hudson.model.PaneStatusProperties>
    <hudson.security.HudsonPrivateSecurityRealm_-Details>
      <passwordHash>#jbcrypt:$2a$10$NqPv3NpgxkpQi/ffEsEkhuMZYpbKc5cVVrP60cD6MX5IujYkLlOGm</passwordHash>
    </hudson.security.HudsonPrivateSecurityRealm_-Details>
    <org.jenkinsci.main.modules.cli.auth.ssh.UserPropertyImpl>
      <authorizedKeys></authorizedKeys>
    </org.jenkinsci.main.modules.cli.auth.ssh.UserPropertyImpl>
    <hudson.search.UserSearchProperty>
      <insensitiveSearch>false</insensitiveSearch>
    </hudson.search.UserSearchProperty>
  </properties>
</user>

如上面的配置文件,把passwordHash改成上面的值(对应密码是123456),账户就是这个文件夹的名称,改好后登录jenkins,在管理平台上修改密码即可。

jenkins忘记密码了怎么办-jenkins找回密码

原文:https://www.cnblogs.com/wsy0202/p/13154487.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!