mak*_*aks 5 windows git ssh putty
我有一个要克隆的远程仓库。我已经设置了 pageant.exe 并添加了私钥。还添加了指向 plink.exe 的 GIT_SSH 变量。在克隆命令之后我得到这样的输出
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.
...
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)
Run Code Online (Sandbox Code Playgroud)
当打字y或n没有任何反应时,控制台只是挂起,我必须终止命令Ctrl+C
为什么会发生这种情况以及如何解决这个问题?
经过几个小时的调查,我终于找到了解决方案。putty 必须知道您要连接的主机,即主机必须是known_hostputty 的。Putty 存储有关know_hosts注册表
HKEY_CURRENT_USER\SoftWare\SimonTatham\PuTTY\SshHostKeys项的信息。要强制 putty 将有关该主机的信息添加到注册表项,我们可以使用您的私钥通过 putty.exe 进行访问。第一次访问时,putty 会要求您将该主机添加到known_hosts. git clone 命令成功完成后。
也许这对某人有帮助,因为乍一看并不明显
| 归档时间: |
|
| 查看次数: |
2525 次 |
| 最近记录: |