![SSH 的最新更新破坏了向后兼容性,如何降级到以前的版本?](https://linux22.com/image/947179/SSH%20%E7%9A%84%E6%9C%80%E6%96%B0%E6%9B%B4%E6%96%B0%E7%A0%B4%E5%9D%8F%E4%BA%86%E5%90%91%E5%90%8E%E5%85%BC%E5%AE%B9%E6%80%A7%EF%BC%8C%E5%A6%82%E4%BD%95%E9%99%8D%E7%BA%A7%E5%88%B0%E4%BB%A5%E5%89%8D%E7%9A%84%E7%89%88%E6%9C%AC%EF%BC%9F.png)
我最近更新了 Ubuntu 系统,然后发现我使用的 SSH 功能在更新的版本中不再受支持。
如何将 sshd.service 恢复到以前的版本?
(是的,我明白老款寿司需要更新,这也会发生)
/etc/ssh/ssh_config
我尝试在客户端上添加以下内容来解决这个问题:
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
但我仍然看到:
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /home/its_demo2/.ssh/id_rsa.pub RSA SHA256:Ml5N2i3iOCN04zqjnpT1y7dQvKOQZT9zsOT5GPE5KFk explicit
debug1: send_pubkey_test: no mutual signature algorithm
debug2: we did not send a packet, disable method
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
答案1
我在连接旧设备时遇到了问题,我通过在客户端Host
部分添加以下几行,使其在 Ubuntu 22.04 和 OpenSSH 8.9 / OpenSSL 3.0.2 中运行:/etc/ssh/ssh_config
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
这将恢复RSA SHA-1
SSH 客户端的旧哈希算法的功能。
注意:请注意,这可能会降低连接的安全性(但仍达到 Ubuntu 20.04 的级别)。