zoukankan      html  css  js  c++  java
  • jenkins忘记密码了怎么办-jenkins找回密码

    一段时间没登录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,在管理平台上修改密码即可。

  • 相关阅读:
    bzoj1644 [Usaco2007 Oct]Obstacle Course 障碍训练课
    bzoj1640 [Usaco2007 Nov]Best Cow Line 队列变换
    bzoj1639 [Usaco2007 Mar]Monthly Expense 月度开支
    bzoj1637 [Usaco2007 Mar]Balanced Lineup
    bzoj1641 [Usaco2007 Nov]Cow Hurdles 奶牛跨栏
    bzoj1635 [Usaco2007 Jan]Tallest Cow 最高的牛
    bzoj1638 [Usaco2007 Mar]Cow Traffic 奶牛交通
    bzoj3407 [Usaco2009 Oct]Bessie's Weight Problem 贝茜的体重问题
    bzoj1631 [Usaco2007 Feb]Cow Party
    bzoj1632 [Usaco2007 Feb]Lilypad Pond
  • 原文地址:https://www.cnblogs.com/wsy0202/p/13154487.html
Copyright © 2011-2022 走看看