@
chengfeng 基本是正确的。严格来说不是 RSA 被废弃,RSA 公钥仍然安全,废弃的只是认证过程中的 ssh-rsa 签名格式,或者说哈希算法。
自从 OpenSSH 7.2,rsa-sha2-* 取代 ssh-rsa 作为默认的 ssh host key algorithm 签名算法。8.2 时通知 ssh-rsa 之后将废弃,8.8 正式废弃了 ssh-rsa.
https://security.stackexchange.com/a/226133/203193> The RFC8332 RSA SHA-2 signature algorithms rsa-sha2-256/512. **These algorithms have the advantage of using the same key type as "ssh-rsa" but use the safe SHA-2 hash algorithms.** These have been supported since OpenSSH 7.2 and are already used by default if the client and server support them.
另外影响的只是 ssh-rsa hash 算法格式,RSA 公钥(即 id_rsa 文件)仍然使用 ssh-rsa 格式。 因为 RSA 公钥不依赖 hash 函数。
https://www.ietf.org/rfc/rfc8332.txt> Since RSA keys are not dependent on the choice of hash function, the new public key algorithms reuse the "ssh-rsa" public key format as
defined in [RFC4253]:
https://superuser.com/a/1488613/733022> RSA keys themselves are neither "SHA1" nor "SHA2" - the key format doesn't involve any hash algorithm at all. The private key just consists of two large numbers, and unlike certificates, there is no attached signature.
https://superuser.com/a/1556861/733022> The key format has not changed. The only thing that changes is the signature format that's sent during each authentication handshake.
---
回归原问题,OpenSSH 8.8 客户端默认不提供 ssh-rsa hash function,而远端服务端不接受非 ssh-rsa 外的 rsa-sha2-*. 协商失败。
目前已知受影响的有
gitee.com,
bitbucket.org.
测试方法: ssh -T git@gitee.com -vv 或者 ssh -T git@bitbucket.org. -vv 开启 debug2 级别日志。在结果中检索 'host key algorithms',注意有 2 条匹配,一条客户端的,一条服务端的。
gitee: ssh-rsa,ssh-dss,ecdsa-sha2-nistp256,ssh-ed25519. OpenSSH 服务端没有支持 rsa-sha2-*.
bitbucket 就更狠了: ssh-rsa,ssh-dss. 根本就不支持任何椭圆曲线签名算法。