2011-03-15 64 views
2

我的验证失败。我已经建立了我的SSH密钥和公共密钥已经被当地的git管理的进口,但我仍然得到提示输入密码:使用git和tortoisegit在Windows XP上验证失败

git.exe clone --progress -v "[email protected]:project.git" "C:\web\project" 
Cloning into C:\web\project... 
[email protected]'s password: 
fatal: The remote end hung up unexpectedly 
  • 我的SSH密钥passphraseless和“C:\Documents and Settings\username\.ssh”下的生活,我也将它们复制到“C:\Documents and Settings\username\ssh”(没有前面的点),只是为了好的措施。
  • 在Windows环境变量的屏幕,HOME系统变量被设置为我的用户正确的目录。

回答

0

ssh -vvv [email protected]返回什么?

只要这个SSH请求不起作用,没有git的操作将与[email protected]服务器工作。
如果ssh的报告,它是确实试图提供公钥,则必须仔细检查它已正确添加到回购服务器上的~git/.ssh/authorized_keys文件。

这里是例子SSH会话中的提取物的工作原理:

debug1: Authentications that can continue: publickey,password,keyboard-interactive 
debug3: start over, passed a different list publickey,password,keyboard-interactive 
debug3: preferred publickey,keyboard-interactive,password 
debug3: authmethod_lookup publickey 
debug3: remaining preferred: keyboard-interactive,password 
debug3: authmethod_is_enabled publickey 
debug1: Next authentication method: publickey 
debug1: Offering public key: /p/.ssh/mypubkey 
debug3: send_pubkey_test 
debug2: we sent a publickey packet, wait for reply 
debug1: Server accepts key: pkalg ssh-rsa blen 277 
debug2: input_userauth_pk_ok: fp f8:d9:7...:cf 

debug3: sign_and_send_pubkey 
debug1: read PEM private key done: type RSA 
debug1: Authentication succeeded (publickey). 
debug1: channel 0: new [client-session] 
debug3: ssh_session2_open: channel_new: 0 
debug2: channel 0: send open 
debug1: Entering interactive session. 

两点意见:

  • %HOME%引用不%HOMEDIR%而是一个自定义驱动器(p:\),这是一个本地公约在工作中,可能不适用于你。
  • 我的公/私钥的名称不遵循默认的标准(id_rsa.pub/id_rsa

我加了config文件中%HOME%\.ssh目录,以名称,明确了公共密钥文件:

host gitrepo 
    user git 
    hostname repo 
    identityfile ~/.ssh/mypubkey 

这样,我可以简单地键入:ssh gitrepo,而ssh将知道使用哪个用户,主机名和确切的完整路径。