我在Jenkins工作中指定存储库路径“ssh:// Administrator @ WS-GIT / GitCentralRepository / Development”时收到此错误。
"Failed to connect to repository : Command "ls-remote -h ssh://Administrator@WS-GIT/GitCentralRepository/Development HEAD" returned status code 128:
stdout:
stderr: FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey,keyboard-interactive)
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists."
我可以在指定相同的存储路径时从GITExtensions客户端克隆此项目。我在Windows 7上运行Jenkins作为Windows服务。请帮助
答案 0 :(得分:0)
我到达此页面基本上遇到了同样的问题,我可以使用jenkins主机上的用户成功运行'git ls-remote',但我无法使用Jenkins凭据插件中的。
我错误配置的内容很愚蠢,凭据插件需要私有密钥而非公共密钥。
我的Jenkins和gerrit服务器都在linux下,但它对这个问题没有任何影响。
以防有人以类似问题到达此页面。 我的情况是我想配置一个非交互式用户(没有passw)来克隆从gerrit到Jenkins的特定仓库。
如果是这种情况,请确保
1)在jenkins中创建一个非交互式组,并将非交互式用户添加到其中 即用户jenkins,首先生成ssh密钥(提供空传递)
ssh-keygen-t rsa
然后在gerrit中创建用户并将其添加到非交互式用户组
cat~jenkis / .ssh / id_rsa.pub | ssh -p 29418 your.gerrit.instance.com gerrit create-account --group“'非交互式用户'” - ssh-key - jenkins
2)确保您尝试克隆的项目具有为非交互式组授予的读取权限(您可以在gerrit webUI中执行此操作)
注意:如果您偶然在gerrit数据库中更改了ssh密钥(因为我尝试解决此问题),您需要刷新gerrit ssh缓存
ssh -p 29418 review.example.com gerrit flush-caches --cache sshkeys
3)确保提供Jenkins凭证插件中步骤2中生成的私钥(.ssh / id_rsa)的内容
4)在你的Jenkins工作中使用如下的网址
SSH://jenkins@your.gerrit.instance.com:29418 / yourRepoName
希望这有助于其他人
菲德
查看此帖子,它可能也会有所帮助http://toastedbits.com/post/26#integration