github报错”You’re using an RSA key with SHA-1, which is no longer allowed…“

本文参考博客:github报错”You’re using an RSA key with SHA-1, which is no longer allowed…“

使用git上传代码,报错内容如下:

ERROR: You're using an RSA key with SHA-1, which is no longer allowed. Please use a newer client or a different key type.
Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

问题原因:
github对秘钥进行升级,导致RSA不再支持。

解决方法:
(1)第一步,生成新的秘钥:
ssh-keygen -t ecdsa -b 521 -C "your_email@example.com"
新秘钥的位置在/home/你的用户名/.ssh文件夹下,新文件名称:

  • id_ecdsa(私钥,一般不用)
  • id_ecdsa.pub(公钥,用于将其添加到github中的ssh-key中)

(2)在github中删除旧的ssh秘钥,添加id_ecdsa.pub为新的秘钥
note:之前没有删除旧的秘钥,会仍旧报错
(3)为了保险起见,将旧的秘钥改名做了备份。

相关推荐

  1. spark1

    2024-02-01 15:36:05       16 阅读
  2. git pushgit@github.com: Permission denied (publickey).

    2024-02-01 15:36:05       14 阅读

最近更新

  1. TCP协议是安全的吗?

    2024-02-01 15:36:05       19 阅读
  2. 阿里云服务器执行yum,一直下载docker-ce-stable失败

    2024-02-01 15:36:05       20 阅读
  3. 【Python教程】压缩PDF文件大小

    2024-02-01 15:36:05       20 阅读
  4. 通过文章id递归查询所有评论(xml)

    2024-02-01 15:36:05       20 阅读

热门阅读

  1. 算法笔记刷题日记——Day1 C_C++在ACM中的常用语法

    2024-02-01 15:36:05       38 阅读
  2. redis基本数据结构使用场景

    2024-02-01 15:36:05       37 阅读
  3. Google 搜索语法

    2024-02-01 15:36:05       25 阅读
  4. 物联网中基于WIFI的室内温度检测系统设计

    2024-02-01 15:36:05       33 阅读
  5. 【力扣经典面试题】121. 买卖股票的最佳时机

    2024-02-01 15:36:05       32 阅读
  6. C. Factorials and Powers of Two -二进制枚举

    2024-02-01 15:36:05       36 阅读
  7. xml 工具类

    2024-02-01 15:36:05       25 阅读
  8. 编译LVGL遇到的问题及解决方式

    2024-02-01 15:36:05       32 阅读
  9. 37.【TypeScript 教程】TSLint 与 ESLint

    2024-02-01 15:36:05       39 阅读
  10. kafka实现延迟队列

    2024-02-01 15:36:05       26 阅读
  11. 2024年1月个人工作生活总结

    2024-02-01 15:36:05       40 阅读
  12. Linux命令之 vim 详解

    2024-02-01 15:36:05       32 阅读