Git 服务器的主机 key 未缓存在注册表中 - GitHub.com

标签 git bash ssh github

问题继续 here : 我正在尝试在 GitHub 上建立我的第一个 Git 存储库。 (注意,这意味着我不能使用 putty,我正在使用 openssh,或者至少我应该并且我认为我是)。我一直在关注 GitHub 网站上的文档 here .直到最后一个命令:git push -u origin master,我都得到了正确的结果。它给了我以下错误:

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
16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48
Connection abandoned. fatal: The remote end hung up unexpectedly

我猜这意味着在我的 known_hosts 文件中找不到它们的 ssh-rsa key ,但我不确定如何解决这个问题。我试过 ssh -T git@github.com 并且我登录得很好。我还尝试关闭 git bash 并重新打开以防缓存问题。这不能解决问题。这是我得到的唯一与文档指示不同的输出。我希望提供一个可爱的 Java Helper Library,因此我们将不胜感激任何帮助!

最佳答案

使用 git-for-windows 和 GIT_SSH 指向 plink.exe,打开服务器的 putty 并接受主机 key (然后终止 putty session ,甚至不继续登录)足以解决这个问题我。

关于Git 服务器的主机 key 未缓存在注册表中 - GitHub.com,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10166173/

相关文章:

git - 从 git repo 中获取文件并且 git 忽略它而不从文件系统中删除它

linux - bash 获取硬件脚本输出到 .csv 文件

linux - 禁用伪 tty 分配

sockets - 与 Control Master 的共享 SSH 连接不起作用

java - 如何使用 JSch 库在 ec2 连接中将 .pem 文件内容用作字符串

Xcode 5 - 如何在工作区中使用源代码管理

Git/Mercurial (hg) 意见

linux - eclipse : impossible to import git project

linux - 为文件夹中的文件创建新的符号链接(symbolic link)

Bash/sh - && 和 ; 之间的区别