【发布时间】:2014-12-27 00:30:05
【问题描述】:
我遇到了与 git - Server host key not cached 中的问题类似的问题,但有一个转折点导致那里的最佳解决方案不起作用。
我正在尝试从 Stash 克隆一个存储库,这是一个来自 Atlassian 的应用程序,例如我们公司用于存储其 git 存储库的 git-hub。在我将公钥输入 Stash 后,我使用 Git Bash 尝试使用系统提供的 ssh 地址从那里克隆存储库。结果如下:
$ git clone ssh://git@stash.mycompany.com:7999/teamproject/gitrepo.git
Cloning into 'gitrepo'...
The server's host key is not cached in the registry. You
have no guarantee that the server is the computer you
think it is.
The server's rsa2 key fingerprint is:
ssh-rsa 2048 xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:12
Connection abandoned.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
由于我没有使用putty尝试连接,所以尝试了用ssh连接服务器的方案:
$ ssh ssh://git@stash.mycompany.com:7999/teamproject/gitrepo.git
ssh: stash.mycompany.com:7999/teamproject/gitrepo.git: no address associated with name
如果我尝试缩短 ssh 可以识别的地址,我得到的指纹与 git 拒绝的指纹不同:
$ ssh ssh://git@stash.mycompany.com
The authenticity of host 'stash.mycompany.com (10.XX.XXX.XX)' can't be established.
RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:34.
Are you sure you want to continue connecting (yes/no)? no
Host key verification failed.
我选择不继续连接,因为如果我确实连接了,它只是将一个不能帮助 git 完成其工作的条目放入我的 known_hosts 文件中。
有人知道如何解决这个问题吗?
【问题讨论】:
-
所以从长远来看,没有“让最好的解决方案不起作用的扭曲”,它只是奏效了。
标签: git ssh git-bash bitbucket-server