我安装了Jenkins作为守护进程(在mac os x 10.7上),我使用'real-os-user
'作为JENKINS USER。
我正在尝试使用git项目(helloworld
)配置作业,但是我收到以下错误:
Failed to connect to repository : Command "git ls-remote -h git-server-name:helloworld HEAD" returned status code 128:
stdout:
stderr: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,keyboard-interactive).
fatal: The remote end hung up unexpectedly
如果我在终端窗口中运行'git ls-remote -h git-server-name:helloworld HEAD
',它可以正常工作。
我打印了“env
”变量,我看到Jenkins正在使用“real-os-user
”..
任何想法都表示赞赏。感谢
答案 0 :(得分:0)
git-server-name:helloworld
是一个ssh地址,因此您需要确保:
HOME
$HOME/.ssh
存在并包含config
文件,id_rsa
和id_rsa.pub
(私钥和公钥):测试{{1}中是否存在这些文件Jenkins的工作用于测试目的。请注意,如果您在用户名后重命名公钥和私钥(因为gitolite希望其公钥以用户ID命名),您的配置文件需要引用该新名称:
helloworld
使用配置文件:
.ssh
real-os-user
real-os-user.pub
config
考虑到您的Host git-server-name
HostName git-server-name
IdentityFile ~/.ssh/real-os-user
User git # or whatever account is managing gitolite on the server side
,这不应成为问题。