【问题标题】:SSH: SourceTree push failsSSH:SourceTree 推送失败
【发布时间】:2016-05-09 14:19:23
【问题描述】:

在将代码推送到仓库中的主分支时,我从 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. 

我没有找到任何东西可以写在那里。我该如何解决?

【问题讨论】:

  • 如果您想信任所有证书,只需输入"y" 并继续。如果您想安装存储库的证书,那么您将需要做更多的工作。你想做什么?
  • 我无法在此处输入 y。没有写的选项。
  • 没有。它以明文提示您,这意味着您输入的内容不会回显到控制台(出于安全原因——他们甚至不希望您的明文密码暂时可见)。只需输入"y" 按回车并吞下药丸。

标签: git github ssh atlassian-sourcetree


【解决方案1】:

避免在 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

【讨论】:

    猜你喜欢
    • 2021-12-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多