跳到主内容
@wquguru
精选90GitHub Changelog云与平台

GitHub SSH弃用ssh-rsa与diffie-hellman-group-exchange-s

Security improvements for SSH

原文
发到 X
推荐理由

涉及核心代码托管平台SSH协议的破坏性变更与明确生效日期,所有依赖SSH进行CI/CD或日常开发的读者必须在2026年1月前完成迁移或升级,否则将失去访问权限。

We’re removing several SSH algorithms, adding a new algorithm, and requiring larger RSA SSH keys to improve security.

我们将移除几种 SSH 算法,添加一种新算法,并要求使用更大的 RSA SSH 密钥以提高安全性。

The changes are as follows:

变更内容如下:

  • We’re removing the ability to use RSA keys using SHA-1 in SSH (i.e., the ssh-rsa signature type, including [email protected] certificates using SHA-1).
  • We’re removing the key exchange mechanism diffie-hellman-group-exchange-sha256.
  • All new RSA SSH keys uploaded after October 14, 2026 must be at least 3072 bits in size, both for signing and authentication.
  • We’re additionally supporting the post-quantum key exchange method mlkem768x25519-sha256 for SSH sessions on github.com and GitHub Enterprise Cloud with Data Residency, except for the U.S. region.
  • 我们将移除在 SSH 中使用基于 SHA-1 的 RSA 密钥的能力(即 ssh-rsa 签名类型,包括使用 SHA-1 的 [email protected] 证书)。
  • 我们将移除密钥交换机制 diffie-hellman-group-exchange-sha256。
  • 2026 年 10 月 14 日之后上传的所有新 RSA SSH 密钥,其大小必须至少为 3072 位,用于签名和身份验证。
  • 此外,我们将为 github.com 和 GitHub Enterprise Cloud with Data Residency(美国地区除外)上的 SSH 会话支持后量子密钥交换方法 mlkem768x25519-sha256。

Adding ML-KEM lets us offer a newer, more performant key exchange method that is secure against quantum computers.

添加 ML-KEM 使我们能够提供一种更新、性能更好且能抵御量子计算机攻击的密钥交换方法。

We’re also removing the older Diffie-Hellman method, a slow, little-used algorithm that could be broken with advances in quantum computing. For RSA, we’re removing the use of SHA-1 since it’s known to be weak, as well as increasing key sizes to align with 128-bit security requirements.

我们还将移除较旧的 Diffie-Hellman 方法,这是一种缓慢且很少使用的算法,可能会因量子计算的进步而被破解。对于 RSA,由于已知 SHA-1 存在弱点,我们将停止使用它,并增加密钥大小以符合 128 位安全要求。

Schedule

时间表

  • October 14, 2026: The new RSA key size requirements take effect. In addition, mlkem768x25519-sha256 will be enabled on github.com and GitHub Enterprise Cloud with Data Residency (except for the U.S. region).
  • November 4, 2026: We’ll have a brownout of the removal of the ssh-rsa signature type (i.e., RSA keys using SHA-1) and the diffie-hellman-group-exchange-sha256 key exchange algorithm.
  • December 9, 2026: We’ll have another brownout for the ssh-rsa signature type and the diffie-hellman-group-exchange-sha256 key exchange algorithm.
  • January 13, 2026: We’ll remove the ssh-rsa signature type and diffie-hellman-group-exchange-sha256 key exchange algorithm.
  • 2026 年 10 月 14 日:新的 RSA 密钥大小要求生效。此外,mlkem768x25519-sha256 将在 github.com 和 GitHub Enterprise Cloud with Data Residency(美国地区除外)上启用。
  • 2026 年 11 月 4 日:我们将对移除 ssh-rsa 签名类型(即使用 SHA-1 的 RSA 密钥)和 diffie-hellman-group-exchange-sha256 密钥交换算法进行棕色停机维护。
  • 2026 年 12 月 9 日:我们将再次对 ssh-rsa 签名类型和 diffie-hellman-group-exchange-sha256 密钥交换算法进行棕色停机维护。
  • 2026 年 1 月 13 日:我们将移除 ssh-rsa 签名类型和 diffie-hellman-group-exchange-sha256 密钥交换算法。

These changes will all take effect in GitHub Enterprise Server in version 3.25, except for the addition of mlkem768x25519-sha256, which will take effect in version 3.24.

这些变更将在 GitHub Enterprise Server 版本 3.25 中全部生效,但 mlkem768x25519-sha256 的添加将在版本 3.24 中生效。

Preparing for these changes

准备应对这些变更

The only affected users are those connecting with a Git client over SSH or those using the unauthenticated Git protocol on GitHub Enterprise Server. If your Git remotes start with https://, nothing here will affect you.

唯一受影响的用户是通过 SSH 连接 Git 客户端或在 GitHub Enterprise Server 上使用未认证 Git 协议的用户。如果您的 Git 远程仓库地址以 https:// 开头,则此处所述的变更不会影响您。

RSA key changes

RSA 密钥变更

If you’re using an existing RSA key, make sure you’re using RSA with SHA-2 (i.e., the rsa-sha2-256 and rsa-sha2-512 signature types). You do not need to generate a new key, since all RSA keys are capable of signing with all hash algorithms. As long as the SSH program or library you’re using supports RSA with SHA-2, you can continue to use the same key without a problem and most SSH implementations supporting RSA with SHA-2 will choose it automatically.

如果您使用的是现有的 RSA 密钥,请确保您使用的是支持 SHA-2 的 RSA(即 rsa-sha2-256 和 rsa-sha2-512 签名类型)。您无需生成新密钥,因为所有 RSA 密钥都能够使用所有哈希算法进行签名。只要您使用的 SSH 程序或库支持带 SHA-2 的 RSA,您就可以继续正常使用相同的密钥,而大多数支持带 SHA-2 的 RSA 的 SSH 实现会自动选择它。

Note the distinction between the key type ssh-rsa, which applies generically to all RSA keys regardless of signature algorithm, and the confusingly named signature type ssh-rsa, which indicates an RSA key using SHA-1 (as opposed to rsa-sha2-256 and rsa-sha2-512, which refer to RSA keys using SHA-256 and SHA-512, respectively).

请注意 key type ssh-rsa 与 signature type ssh-rsa 之间的区别:前者泛指所有 RSA 密钥,无论其签名算法如何;后者名称具有误导性,表示使用 SHA-1 的 RSA 密钥(与 rsa-sha2-256 和 rsa-sha2-512 相对,后者分别指使用 SHA-256 和 SHA-512 的 RSA 密钥)。

Here’s a list of some common software that uses SSH to connect to GitHub and the version necessary to support RSA with SHA-2 robustly with the default configuration:

以下是部分使用 SSH 连接到 GitHub 的常见软件列表,以及默认配置下稳健支持带 SHA-2 的 RSA 所需的最低版本:

SoftwareMinimum Version
OpenSSH7.2p1
JSch0.1.66 from this fork
TeamCity2021.2.3
Go SSH0.16.0
libssh21.11.0
PuTTY0.82
软件最低版本
OpenSSH7.2p1
JSch来自此分支的 0.1.66
TeamCity2021.2.3
Go SSH0.16.0
libssh21.11.0
PuTTY0.82

Alternatively, if you’re using older software and can’t upgrade, you may be able to use an Ed25519 or ECDSA key instead. All Ed25519 and ECDSA keys we support are strong, secure, and will continue to work for the indefinite future.

或者,如果您使用的是无法升级的旧版软件,您可以尝试改用 Ed25519 或 ECDSA 密钥。我们支持的所有 Ed25519 和 ECDSA 密钥都强大且安全,并将长期有效。

For generating new keys, we recommend using an Ed25519 key whenever possible. However, if you still need an RSA key for compatibility with other services, you can generate one as long as it as at least 3072 bits in size.

对于生成新密钥,我们建议尽可能使用 Ed25519 密钥。但是,如果您出于与其他服务的兼容性考虑仍需要 RSA 密钥,只要其长度至少为 3072 位,就可以生成一个。

Removal of diffie-hellman-group-exchange-sha256

移除 diffie-hellman-group-exchange-sha256

If you’re using one of the SSH implementations above that supports RSA with SHA-2, it should also support a strong key exchange mechanism.

如果您使用的是上述支持带 SHA-2 的 RSA 的 SSH 实现之一,它也应该支持强密钥交换机制。

New post-quantum algorithms

新的后量子算法

The addition of the mlkem768x25519-sha256 shouldn’t require any changes from users. SSH clients will automatically use the new algorithm by default if configured to prefer it. Users who use an older SSH client should automatically fall back to an older key exchange algorithm.

添加 mlkem768x25519-sha256 不应要求用户进行任何更改。如果配置为优先使用该算法,SSH 客户端将默认自动使用新算法。使用较旧 SSH 客户端的用户应自动回退到较旧的密钥交换算法。

更进一步:量化金融体系

看懂新闻只是起点——沿量化金融路径,把它变成能交付的工程能力

进入量化体系 →

相似阅读

关联信息,但可能不是同一事件