如何在 Git 中取消链接以前的 SSH 密钥

发布于 2025-01-10 02:17:54 字数 633 浏览 0 评论 0原文

我已按照以下步骤创建和添加 SSH 密钥,并删除了文件夹 ~/.ssh/

  • $ ssh-keygen -t rsa -b 4096 -C "[电子邮件受保护]"
  • $ eval "$(ssh-agent -s)"
  • $ ssh-add -K ~/.ssh/id_rsa
  • $ Clip < 〜/.ssh/id_rsa.pub 然后在 Git 中添加内容

然后我尝试:

  • $ git push -u origin master

,我得到:

无法建立主机 'github.com (140.82.121.4)' 的真实性。 ED25519 密钥指纹为 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU。 该密钥没有任何其他名称。您确定要继续连接吗(是/否/[指纹])?

(该密钥是我之前创建和删除的密钥之一)

我可以做什么来解决这个问题?

I have followed the following steps to create and add a SSH key and deleted all the previously created keys in the folder ~/.ssh/

  • $ ssh-keygen -t rsa -b 4096 -C "[email protected]"
  • $ eval "$(ssh-agent -s)"
  • $ ssh-add -K ~/.ssh/id_rsa
  • $ clip < ~/.ssh/id_rsa.pub
    and then added the content in Git

Then I try:

  • $ git push -u origin master

and I get:

The authenticity of host 'github.com (140.82.121.4)' can't be established.
ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU.
This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])?

(That key is one of the previous I had created and deleted)

What can I do to overcome this issue?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

↙温凉少女 2025-01-17 02:17:54

无法确定主机“github.com (140.82.121.4)”的真实性。 ED25519 密钥指纹为 SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU。该密钥没有任何其他名称。您确定要继续连接吗(是/否/[指纹])?

此消息与您创建的密钥无关。第一次连接到任何 SSH 服务器时,您都会收到类似这样的消息。您连接到的 SSH 服务器首先向您的 ssh 客户端标识自己,此消息意味着您的客户端无法识别它连接到的服务器。

您通常会通过键入“yes”并按 Enter 来回复此问题,除非您有特殊理由相信正在发生一些有趣的事情。

The authenticity of host 'github.com (140.82.121.4)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names. Are you sure you want to continue connecting (yes/no/[fingerprint])?

This message has nothing to do with the key that you created. You'll get a message like this the first time you connect to any SSH server. The SSH server that you connected to starts by identifying itself to your ssh client, and this message means that your client doesn't recognize the server that it connected to.

You would generally reply to this by typing "yes" and pressing Enter, unless you have a particular reason to believe something funny is going on.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文