使用 Putty 的 Git 扩展:服务器主机密钥未缓存在注册表中(但我认为是)

使用 Putty 的 Git 扩展:服务器主机密钥未缓存在注册表中(但我认为是)

按照下面的命令,我觉得我的密钥已添加到“注册表”中。我在做什么,或者 Putty 在哪里搞砸了。我应该注意,scp 单独工作,因为我将我的 id_rsa 密钥从我的 cygwin 安装复制到我的 /c/Users/mehoggan/.ssh 目录,然后 ssh-add 了它。然而,git 部分不起作用。我的 .ppk 文件位于 PuTTY 的默认位置 /c/Users/mehoggan/Documents。公共版本被复制并粘贴到 gerrit。

$ /c/Program\ Files/GitExtensions/PuTTY/plink.exe -P 29418 -l mehoggan matthewh.me
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:
"finger print"
If you trust this host, enter "y" to add the key to
PuTTY's cache and carry on connecting.
If you want to carry on connecting just once, without
adding the key to the cache, enter "n".
If you do not trust this host, press Return to abandon the
connection.
Store key in cache? (y/n) y
Using username "mehoggan".

  ****    Welcome to Gerrit Code Review    ****

  Hi Matthew Hoggan, you have successfully connected over SSH.

  Unfortunately, interactive shells are disabled.
  To clone a hosted Git repository, use:

  git clone ssh://[email protected]:29418/REPOSITORY_NAME.git


mehoggan@MEHOGGAN-PC ~/Devel
$ git clone ssh://[email protected]:29418/gerrit-userstats && scp -p -P 29418 mehoggan@www
.matthewh.me:hooks/commit-msg gerrit-userstats/.git/hooks/
Cloning into 'gerrit-userstats'...
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:
<finger print>
Connection abandoned.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

答案1

在第一部分中,您连接到matthewh.me,在第二部分中,您连接到www.matthewh.met

第一个连接存储了的主机密钥matthewh.me

第二个连接要求输入主机密钥,因为密钥www.matthewh.me尚未存储。

您应该使用 putty 连接到www.matthewh.me,并在运行 git 之前存储主机密钥。

相关内容