我已经在这个问题上苦苦挣扎了一整天,它让我发疯!
- 我在Win7 PC上安装了Git,并选择了PuttyGen选项进行安装。
- 我使用PuttyGen生成了ssh密钥,并将ssh密钥添加到我的Git帐户中,并链接了Pageant中的私钥。
- 我设置了GIT_SSH,使其指向我的putty plink.exe。
- 我使用Putty连接到codaset和git,以将它们作为已知主机接受。
在控制台中,我可以克隆,但Hudson失败了:
Fetching upstream changes from git@codaset.com:xxx/xxx.git
[workspace] $ "C:\Program Files\Git\bin\git.exe" fetch -t git@codaset.com:xxx/xxx.git +refs/heads/*:refs/remotes/origin/*
ERROR: Problem fetching from origin / origin - could be unavailable. Continuing anyway
ERROR: Could not fetch from any repository
FATAL: Could not fetch from any repository
hudson.plugins.git.GitException: Could not fetch from any repository
...
如果我在控制台中运行完全相同的git命令,它可以正常工作:
"C:\Program Files\Git\bin\git.exe" fetch -t git@codaset.com:xxx/xxx.git +refs/heads/*:refs/remotes/origin/*
我尝试了直接使用plink连接到GitHub:
plink -agent -v git@github.com
Looking up host "github.com"
...
Pageant is running. Requesting keys.
Pageant has 1 SSH-2 keys
Using username "git".
...
Authenticating with public key "rsa-key-20110121" from agent
...
Hi xxx! You've successfully authenticated, but GitHub does not provide
shell access.
我随后尝试连接到Codaset:
plink -agent -v git@codaset.co
m
Looking up host "codaset.com"
Pageant is running. Requesting keys.
Pageant has 1 SSH-2 keys
Using username "git".
...
Authenticating with public key "rsa-key-20110121" from agent
...
Opened channel for session
Server refused to allocate pty
Started a shell/command
Error: Command is required.
...
Server sent command exit status 255
Disconnected: All channels closed
所以,与git不同,codaset的响应略有不同。然而,我认为这可能是一个误导,因为如果我尝试从hudson连接到标准的git项目,我会得到相同的错误。
我还设置了Go Server(之前是CruiseControl),并在此处尝试连接到git时遇到类似的错误:
ERROR: FATAL ERROR: Disconnected: No supported authentication methods available
ERROR: fatal: The remote end hung up unexpectedly
这让我想到问题可能出在认证上,而不是Hudson细节上...
像往常一样,非常感谢您的帮助!