git - Hudson(Jenkins) 和远程 git 存储库获得权限被拒绝

标签 git ssh hudson jenkins gitosis

我已经设置了 hudson 从我的远程 git 存储库中 checkout ,但我得到了

**Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).**

我的 git 存储库使用 gitosis 并在我通过命令行克隆时工作。 Hudson 以同一用户身份运行

这是日志的较大部分,其中编辑了主机名和目录
Checkout:workspace / /Users/me/.hudson/jobs/HudsonJob/workspace - hudson.remoting.LocalChannel@363adfb4
Cloning the remote Git repository
Cloning repository origin
ERROR: Error cloning remote repo 'origin' : Could not clone gitosis@myserver:myproject
ERROR: Cause: Error performing command: /opt/local/bin/git clone -o origin gitosis@myserver:myproject /Users/me/.hudson/jobs/HudsonJob/workspace
Command "/opt/local/bin/git clone -o origin gitosis@myserver:myproject /Users/me/.hudson/jobs/HudsonJob/workspace" returned status code 128: Cloning into /Users/me/.hudson/jobs/HudsonJob/workspace...
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).
fatal: The remote end hung up unexpectedly

我还尝试从命令行运行以下命令
/opt/local/bin/git clone -o origin gitosis@myserver:myproject /Users/me/.hudson/jobs/HudsonJob/workspace

它可以工作,但我必须指定密码才能工作。

我的猜测是 hudson 构建失败,因为它必须提示输入密码。
通常我猜想将我的公钥添加到 .ssh/authorized key 可以完成这项工作,但是 gitosis 的授权 key 会使用一些额外的命令自动生成该公钥。

所以我想知道如何在不输入密码的情况下允许 hudson 访问?

最佳答案

首先,我建议使用 gitolite,因为 gitosis 不再积极发展。

使用不需要密码的 key 。

关于git - Hudson(Jenkins) 和远程 git 存储库获得权限被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6324661/

相关文章:

Github 不缓存我的密码

windows - 尝试连接 SSH 时权限被拒绝(公钥)

git - 将 Git 子模块转换为子树后 merge 错误

git - 在 git pre-receive hook 中访问更改的文件路径

Git 全局忽略不工作

ssh - ssh -F配置文件和ProxyCommand

bash - 将参数传递给ssh中的远程shell

java - 如何正确解决 Hudson 和 ant 的部署权限问题?

netbeans - 在 Jenkins 上设置 Netbeans 项目

ant - Windows 上的 hudson : what is better - Ant files or Batch files?