Ubuntu16.04连接SSH出现 Server responded “Algorithm negotiation failed” 的解决方法

今天安装了Ubuntu16.04虚拟机,与SSH连接时出现了如下问题

Ubuntu16.04连接SSH出现 Server responded “Algorithm negotiation failed” 的解决方法

解决方法如下:

(写在前面:请先确保自己已经给Ubuntu安装了SSH服务。安装方法是在root模式下,终端输入命令apt-get install vim ssh

1. 在Ubuntu终端中输入如下命令,进入配置文件

vim /etc/ssh/sshd_config

Ubuntu16.04连接SSH出现 Server responded “Algorithm negotiation failed” 的解决方法

2. 找到如图的文本

Ubuntu16.04连接SSH出现 Server responded “Algorithm negotiation failed” 的解决方法

将此处文本修改为下图所示(注释掉“PermitRootLogin prohibit-password”,另起一行添加“PermitRootLogin yes”)

Ubuntu16.04连接SSH出现 Server responded “Algorithm negotiation failed” 的解决方法

3. 将光标移动到文档末尾,在文档末尾添加如下文本

 

Ciphers aes128-cbc,aes192-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr,3des-cbc,arcfour128,arcfour256,arcfour,blowfish-cbc,cast128-cbc
MACs hmac-md5,hmac-sha1,[email protected],hmac-ripemd160,hmac-sha1-96,hmac-md5-96
KexAlgorithms diffie-hellman-group1-sha1,diffie-hellman-group14-sha1,diffie-hellman-group-exchange-sha1,diffie-hellman-group-exchange-sha256,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group1-sha1,[email protected]

如图所示:

Ubuntu16.04连接SSH出现 Server responded “Algorithm negotiation failed” 的解决方法

4. 使用命令“ESC + : + x”退出文本编辑。然后在命令行输入命令 service ssh restart

Ubuntu16.04连接SSH出现 Server responded “Algorithm negotiation failed” 的解决方法

5. 回到PC机,打开SSH软件,点击Quick Connect按钮,输入Ubuntu虚拟机的ip地址以及用户名(用户名一定要输入root,否则可能会导致SSH中某些操作权限不够)

Ubuntu16.04连接SSH出现 Server responded “Algorithm negotiation failed” 的解决方法

6. 点击连接,输入密码,点击OK

Ubuntu16.04连接SSH出现 Server responded “Algorithm negotiation failed” 的解决方法

7. 大功告成