overflow_decade 2022-12-31 22:01 采纳率: 60%
浏览 83

github配置了ssh公钥后仍然无法git连接

问题遇到的现象和发生背景

很久没有用过git和github了,今天打算从网上拉一些东西发生报错。重新生成了公钥并在github上删除原公钥重新配置了,发现再次登录需要密码,而且不是我的github账号密码。

遇到的现象和发生背景,请写出第一个错误信息

当我按照网上的教程重新配置ssh公钥后用“ssh -T mailto:git@github.com”命令进行测试时,弹出的信息为“The authenticity of host 'github.com (::1)' can't be established.
ECDSA key fingerprint is SHA256:(密钥)”【按照教程来看这里的ECDSA应该是RSA】,随后要求我输入密码,我尝试输入github的账户密码,一直报错。

用代码块功能插入代码,请勿粘贴截图。 不用代码块回答率下降 50%
$ ssh -T git@github.com
The authenticity of host 'github.com (::1)' can't be established.
ECDSA key fingerprint is SHA256:(密钥)
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com' (ECDSA) to the list of known hosts.

                            ****USAGE WARNING****

This is a private computer system. This computer system, including all
related equipment, networks, and network devices (specifically including
Internet access) are provided only for authorized use. This computer system
may be monitored for all lawful purposes, including to ensure that its use
is authorized, for management of the system, to facilitate protection against
unauthorized access, and to verify security procedures, survivability, and
operational security. Monitoring includes active attacks by authorized entities
to test or verify the security of this system. During monitoring, information
may be examined, recorded, copied and used for authorized purposes. All
information, including personal information, placed or sent over this system
may be monitored.

Use of this computer system, authorized or unauthorized, constitutes consent
to monitoring of this system. Unauthorized use may subject you to criminal
prosecution. Evidence of unauthorized use collected during monitoring may be
used for administrative, criminal, or other adverse action. Use of this system
constitutes consent to monitoring for these purposes.


git@github.com's password:
(随后无论输入什么都无法访问)

运行结果及详细报错内容

如上所示,即使输入正确的github账户密码也无法进行访问。

我的解答思路和尝试过的方法,不写自己思路的,回答率下降 60%

我最后参考的教程是按照这个进行的:https://www.cnblogs.com/wanna2leo/p/16503723.html
比较奇怪的点是我加密方式是rsa,但是提示貌似表示我采用的是ECDSA加密的。无论我多少次重新生成ssh公钥并在github上重置,均告失败。【看见网上说不同的打开.pub文件可能导致内容不同,但是无论我采用记事本、vscode还是命令行cat方式打开,均告失败】

我想要达到的结果,如果你需要快速回答,请尝试 “付费悬赏”

我2022年初时配置ssh公钥过程相当顺利,不知道这次出什么问题了。希望我能够正常使用ssh公钥进行无密码访问。

  • 写回答

3条回答 默认 最新

  • overflow_decade 2023-01-01 20:37
    关注

    自己解决了,不用麻烦后来人了。如果有后来者遇到一样的问题,请尝试"ssh -T -p 443 git@ssh.github.com"能否连接上,如果能,请参考:
    https://blog.csdn.net/yuzhiqiang_1993/article/details/127032178

    评论

报告相同问题?

问题事件

  • 修改了问题 12月31日
  • 创建了问题 12月31日