詹金斯中存储的加密密钥在哪里? [英] Where's the encryption key stored in Jenkins?
问题描述
我正在尝试将凭据从一个Jenkins迁移到另一个Jenkins,但是用户名/密码散列在$ {JENKINS_HOME}/credentials.xml
I am trying to migrate the credentials from one Jenkins to another but usernames/passwords are hashed in ${JENKINS_HOME}/credentials.xml
我找到了这个答案,但是问题是它并没有说明有人会在哪里顺序找到加密密钥.成功迁移凭据.
I found this answer, but the problem is it doesn't explain where would someone find the encryption key in order to successfully migrate credentials.
任何帮助将不胜感激!
编辑:更多信息..我的$ {JENKINS_HOME}在一个单独的卷上,我将其分离并重新附加到新的VM上,但仍然无法使用.> >
EDIT: More information.. my ${JENKINS_HOME} is on a separate volume which I detach and re-attach onto the new VM, and it still doesn't work with me.
推荐答案
我发现此分析非常有用.简而言之:
I found this analysis very helpful. In a nutshell:
Jenkins使用master.key加密密钥hudson.util.Secret. 然后,该密钥用于对凭据.xml中的密码进行加密.
Jenkins uses the master.key to encrypt the key hudson.util.Secret. This key is then used to encrypt the password in credentials.xml.
当我需要使用一些默认密码来引导新的Jenkins实例时,我使用包含以下内容的模板目录树
When I need to bootstrap new Jenkins instances with some default passwords, I use a template directory tree that contains
-
secrets/hudson.util.Secret
和 -
secrets/master.key
secrets/hudson.util.Secret
andsecrets/master.key
这很好.
这篇关于詹金斯中存储的加密密钥在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!