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,在管理平台上修改密碼即可。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM