git SSH:SourceTree推送失败

kcwpcxri  于 2023-03-28  发布在  Git
关注(0)|答案(2)|浏览(332)

在repo中将代码推送到master分支时,我从sourceTree中发现了这条消息我已经在github中添加了公钥并生成了私钥并添加到了我的选美密钥列表中。消息是:

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.

我在那里没有找到任何东西可以写。我怎么解决这个问题?

qij5mzcb

qij5mzcb1#

显然,我的sourcetree安装使用putty作为ssh连接。通过尝试在putty中连接到服务器,我可以使用input并将密钥添加该高速缓存中。在此之后,sourcetree push工作。

k5hmc34c

k5hmc34c2#

避免在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 has updated its RSA SSH host key

相关问题