Ssh

使用 Putty 的 Git 擴展:伺服器主機密鑰未記憶體在系統資料庫中(但我認為是)

  • September 5, 2014

按照下面的命令,我的印像是我的密鑰已添加到“系統資料庫”中。我在做什麼,或者膩子在哪裡搞砸了。我應該注意到 scp 單獨起作用,因為我將 id_rsa 密鑰從我的 cygwin 安裝複製到我的 /c/Users/mehoggan/.ssh 目錄並 ssh-add’d。然而,它是 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://mehoggan@www.matthewh.me:29418/REPOSITORY_NAME.git


mehoggan@MEHOGGAN-PC ~/Devel
$ git clone ssh://mehoggan@www.matthewh.me: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.

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

第一個連接儲存了matthewh.me.

第二個連接請求主機密鑰,因為www.matthewh.me尚未儲存密鑰。

您應該使用 putty 連接到www.matthewh.me,並在執行 git 之前儲存主機密鑰。

引用自:https://serverfault.com/questions/626416