gpt4 book ai didi

github - 为什么 GitHub 可能会报告公钥无效?

转载 作者:行者123 更新时间:2023-12-04 11:56:37 24 4
gpt4 key购买 nike

关闭。这个问题是off-topic .它目前不接受答案。












想改善这个问题吗? Update the question所以它是 on-topic对于堆栈溢出。

9年前关闭。




Improve this question




我已经生成了 ssh key 。
结果是:

Your identification has been saved in /home/rajani/.ssh/id_rsa.
Your public key has been saved in /home/rajani/.ssh/id_rsa.pub.

key 采用十六进制十进制格式,但将其添加到 GitHub 时,出现如下错误:
Key is invalid. 
It must begin with 'ssh-rsa' or 'ssh-dss'.
Check that you're copying the public half of the key .

我应该如何正确地将 ssh key 添加到 GitHub?

最佳答案

问题

  • ssh-keygen 实用程序通常默认生成 RSA key ,但您的实现可能默认为 ECDSA,GitHub 目前不支持。
  • 如果您真的要生成 RSA key ,您可能会尝试将您的私钥而不是您的公钥粘贴到服务器。

  • 解决方案
  • 通过传递 强制生成 RSA key -t 标记到 ssh-keygen。
  • 确保您使用 复制 key .pub 扩展名,并且您包括整行。这将包括 ssh-rsa 如果您要复制 RSA 公钥,请使用前缀。

  • 有关的

    当然, man 1 ssh-keygen是你的 friend 。

    关于github - 为什么 GitHub 可能会报告公钥无效?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10897549/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com