简体   繁体   English

从备份恢复 Jenkins 配置后无法访问 git 存储库

[英]Unable to access git repository after restoring Jenkins configuration from backup

I did jenkins configuration backup by copying files from JENKINS_HOME directory.我通过从 JENKINS_HOME 目录复制文件来进行 jenkins 配置备份。 I copied them to Jenkins home directory on a different machine with a fresh Jenkins installation.我将它们复制到具有全新 Jenkins 安装的另一台机器上的 Jenkins 主目录。 When i opened one of the jobs that requires downloading files from git repository i get当我打开需要从 git 存储库下载文件的作业之一时,我得到

Failed to connect to repository : Command "C:\Program Files\Git\cmd\git.exe ls-remote -h git@git.path.com:project/main.git HEAD" returned status code 128:
stdout: 
stderr: Load key "C:\\WINDOWS\\TEMP\\ssh1234567.key": invalid format 
Permission denied, please try again. 
Permission denied, please try again. 
git@git.path.com: Permission denied (publickey,password). 
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

But the credentials are present under Jenkins credentials.但是凭据存在于 Jenkins 凭据下。 .ssh folder was copied as well. .ssh 文件夹也被复制了。 Any suggestions regarding what might have gone wrong?关于可能出了什么问题的任何建议?

The same error occurs to me, my situation is:同样的错误发生在我身上,我的情况是:

I copies id_rsa.pub public key to jenkins credentials, but id_rsa.pub public key is for gitub\\gitlab... while id_rsa this private key is for jenkins credentials

After I copies id_rsa this private key to jenkins credentials, all things work fine~在我将 id_rsa 这个私钥复制到 jenkins 凭证后,一切正常~

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM