简体   繁体   English

将Jenkins配置为在Windows上使用GIT,得到stderr:权限被拒绝(公钥)

[英]Configure Jenkins to use GIT On Windows, Got stderr: Permission denied (publickey)

My Git version is 1.8.0, for this version, the Git installation path in Jenkins is C:\\Git\\cmd\\git.exe (in older versions, it is C:\\Git\\cmd\\git.cmd). 我的Git版本是1.8.0,对于此版本,Jenkins中的Git安装路径是C:\\ Git \\ cmd \\ git.exe(在旧版本中,它是C:\\ Git \\ cmd \\ git.cmd)。 This solves the problem that I had: error deleting workspace. 这解决了我遇到的问题:删除工作区时出错。 In Jenkins, Git repository URL uses the ssh protocol: git@github.com:xxxxx/xxx.git, for me, this URL works. 在Jenkins中,Git存储库URL使用ssh协议:git@github.com:xxxxx / xxx.git,对我而言,此URL有效。 If your key can't be found, this URL will return an error, you need to define %HOME%, then your key should be in %HOME%.ssh. 如果找不到您的密钥,则此URL将返回错误,您需要定义%HOME%,然后密钥应位于%HOME%.ssh中。 then I started to build. 然后我开始建造。 When I built it, I got: 构建它时,我得到了:

 stdout: Cloning into 'C:\Jenkins\workspace\Lily'...

 stderr: Permission denied (publickey).
 fatal: Could not read from remote repository.

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

at hudson.plugins.git.GitAPI.launchCommandIn(GitAPI.java:897)
at hudson.plugins.git.GitAPI.access$000(GitAPI.java:42)

I don't understand why Jenkins can find my key for the repository URL, but can't find my key when it clones the repository. 我不明白为什么Jenkins可以为存储库URL找到我的密钥,但是在克隆存储库时却找不到我的密钥。

Any help will be greatly appreciated. 任何帮助将不胜感激。

My company has a proxy server, for me, to use SSH protocol is very difficult, it may have a way to solve the combination of a proxy server and ssh-to-github, but I gave up. 我公司有一个代理服务器,对我来说,使用SSH协议非常困难,它可能有办法解决代理服务器和ssh-to-github的结合,但是我放弃了。 In stead, I used https protocol. 相反,我使用了https协议。 In order not to prompt credentials for Jenkins, I used github credential cache to solve this. 为了不提示有关Jenkins的凭据,我使用github凭据缓存来解决此问题。 Check here for credential cache: http://www.kernel.org/pub/software/scm/git/docs/git-credential-cache.html . 在此处检查凭证缓存: http : //www.kernel.org/pub/software/scm/git/docs/git-credential-cache.html Now my Jenkins/Git build works in Windows. 现在,我的Jenkins / Git构建可在Windows中运行。

暂无
暂无

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

相关问题 Windows 上的 Git [权限被拒绝(公钥)] 的 Jenkins 问题 - Jenkins issue with Git [Permission denied (publickey).] on Windows 为什么 git@github.com:Windows 中的权限被拒绝(公钥)? - Why git@github.com: Permission denied (publickey) in windows? 设置 Jenkins 时权限被拒绝(公钥) - Permission denied (publickey) when setting up Jenkins IntelliJ IDEA git 权限被拒绝(公钥) - IntelliJ IDEA git Permission denied (publickey) 权限被拒绝(公钥)-用Git不能推入或拉出 - Permission denied (publickey) - Cant push or pull with Git 使用与 Windows 主机共享的存储库在“git fetch”上的 Ubuntu VM 上突然出现“权限被拒绝(公钥)” - Suddenly getting “Permission denied (publickey)” on Ubuntu VM on “git fetch” using repository shared with Windows host 使用Moovweb时Windows上的权限被拒绝(publickey)错误 - Permission denied (publickey) errors on Windows when using Moovweb Git 子模块:git@github.com:权限被拒绝(公钥)。 致命:无法从远程存储库中读取 - Git submodule: git@github.com: Permission denied (publickey). fatal: Could not read from remote repository git@gitlab.com:权限被拒绝(公钥)。 致命:无法从远程存储库读取 - git@gitlab.com: Permission denied (publickey). fatal: Could not read from remote repository 对于 ssh 连接,在 Anaconda、Windows 中出现错误“无法加载密钥 ----,格式无效,权限被拒绝(公钥)” - For ssh connection, getting error "Failed to load key ----, invalid format, Permission denied (publickey)" in Anaconda, Windows
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM