【发布时间】:2015-03-12 01:48:08
【问题描述】:
我已经安装了 msysgit 并且 git 使用了正确的 ssh.exe。所有命令都在 msysgit shell(程序文件 x86 sh.exe)中执行。 然后我将我的 ~/.ssh/config 文件设置为此
LogLevel DEBUG1
Host bitbucket.com
HostName bitbucket.com
PreferredAuthentications publickey
IdentityFile /d/ssh/bitbucket.ppk
IdentitiesOnly yes
然后ssh bitbucket.com 运行良好:
$ ssh bitbucket.com
debug1: Connecting to bitbucket.com [131.103.20.173] port 22.
debug1: Connection established.
debug1: identity file /d/ssh/bitbucket.ppk type -1
debug1: identity file /d/ssh/bitbucket.ppk-cert type -1
但是当我尝试git clone git@bitbucket.org:User/reponame.git ssh 时,调试消息显示 ssh 甚至不尝试选择 bitbucket ppk,而是尝试使用默认密钥:
$ git clone git@bitbucket.org:user/reponame.git
Cloning into 'reponame'...
debug1: Connecting to bitbucket.org [131.103.20.168] port 22.
debug1: Connection established.
debug1: identity file /c/Users/bob/.ssh/id_rsa type -1
debug1: identity file /c/Users/bob/.ssh/id_rsa-cert type -1
debug1: identity file /c/Users/bob/.ssh/id_dsa type -1
debug1: identity file /c/Users/bob/.ssh/id_dsa-cert type -1
debug1: identity file /c/Users/bob/.ssh/id_ecdsa type -1
debug1: identity file /c/Users/bob/.ssh/id_ecdsa-cert type -1
debug1: identity file /c/Users/bob/.ssh/id_ed25519 type -1
debug1: identity file /c/Users/bob/.ssh/id_ed25519-cert type -1
我没有想法。
$ where git
C:\Program Files (x86)\Git\bin\git.exe
C:\Program Files (x86)\Git\cmd\git.exe
【问题讨论】:
标签: windows git ssh msysgit openssh