我安装openssh-server
的Ubuntu server 16.04
和/etc/ssh/ssh_config
我说:
MaxAuthTries 3
PasswordAuthentication YES
Run Code Online (Sandbox Code Playgroud)
然后重新启动 ssh 服务器。当我尝试使用 ssh 从不同的 PC 连接时,我收到一条消息
Algorithm Negotiation failed
回到服务器,当我运行时出现systemctl status ssh
此错误
Unable to negotiate with 192.168.0.132 port 63428: no matching key exchange method found. Their offer: diffie-hellman-group1-sha1
我编辑/etc/ssh/sshd_config
添加我添加行
KexAlgorithms=+diffie-hellman-group1-sha1
Run Code Online (Sandbox Code Playgroud)
现在我得到一个不同的错误,当我运行 systemctl status ssh
Unable to negotiate with 192.168.0.132 port 63428: no matching key exchange method found. Their offer: aes128-cbc,3des-cbc, blowfish-cbc,cast128-cbc,twofish-cbc,arcfour [preauth]
您正在从一些非常旧的 SSH 客户端连接到新系统(Ubuntu 16.04),该客户端不支持任何现代算法,这就是它无法连接的原因。你真的应该更新你的客户端。
或者继续启用目前可能不安全的过时协议。使用
KexAlgorithms +diffie-hellman-group1-sha1
Ciphers +aes128-cbc
Run Code Online (Sandbox Code Playgroud)
你应该能够连接。