You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

配置YubiKey后Cargo更新依赖遇RSA SHA-1密钥错误

Cargo test报错:GitHub提示使用RSA SHA-1密钥(实际使用合规YubiKey密钥)
  • 最近配置了YubiKey用于GitHub提交签名,该功能运行正常,但意外的是克隆公共仓库也需要通过YubiKey验证(这点尚可接受)。
  • 执行cargo test时出现错误,Git提示我使用了RSA SHA-1密钥,出于安全考虑该密钥已被禁用。
  • 我确认未使用任何RSA SHA-1密钥:~/.ssh/known_hosts文件中仅有rsa-ed25519和rsa-sha2两种密钥,且密钥来自YubiKey,应为合规版本。
  • 目前不知道从何处开始调试该问题,错误信息如下:
rogerbos@rogers-mbp resistor-color % cargo test                                  
    Updating crates.io index
error: failed to get `enum-iterator` as a dependency of package `resistor-color v1.0.0 (/Users/rogerbos/Exercism/rust/resistor-color)`

Caused by:
  failed to load source for dependency `enum-iterator`

Caused by:
  Unable to update registry `crates-io`

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  failed to authenticate when downloading repository: git@github.com:rust-lang/crates.io-index

  * attempted ssh-agent authentication, but no usernames succeeded: `git`

  if the git CLI succeeds then `net.git-fetch-with-cli` may help here
  https://doc.rust-lang.org/cargo/reference/config.html#netgit-fetch-with-cli

Caused by:
  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.

  ; class=Ssh (23); code=Eof (-20)

内容的提问来源于stack exchange,提问作者Roger J Bos CFA

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.06 10:01:13