SSH:SourceTree推送失败

3
在将代码推送到仓库的主分支时,我在sourceTree中发现了以下消息。尽管我已经添加了公钥到我的github账户,在我的pageant密钥列表中生成了私钥并添加了它。消息如下:
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

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. 

在此输入图片描述

我没有找到要写的东西。该怎么解决?


如果你想信任所有证书,只需输入“y”并继续即可。如果你想安装存储库的证书,那么你需要做更多的工作。你想怎么做? - Tim Biegeleisen
我无法输入 y。没有写的选项。 - Istiak Morsalin
不。它会提示您输入清晰的文本,这意味着您输入的内容不会被回显到控制台上(出于安全原因,他们甚至不希望您的明文密码在短时间内可见)。只需键入“y”,按回车并吞下药丸即可。 - Tim Biegeleisen
问题仍然存在。而且这是通过 Source Tree 的用户界面完成的 - 它会打印消息,但不提供输入。 - Tigris
警告:2023年3月:“GitHub已更新其RSA SSH主机密钥 - VonC
2个回答

1

显然,我的sourcetree安装使用putty进行ssh连接。通过尝试在putty中连接服务器,我可以使用输入并将密钥添加到缓存中。之后,sourcetree的推送就成功了。


0

避免在 SourceTree 中看到这个问题的一种方法是预先填充 known_hosts 文件:

ssh-keyscan -H github.com >> $HOME/.ssh/known_hosts
# on Windows, with `<git>/usr/bin` in the `%PATH%`
ssh-keyscan -H github.com >> %USERPROFILE%\.ssh\known_hosts

2023年3月警告:

"GitHub已更新其RSA SSH主机密钥"



网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接