错误
利用java
连接Linux
服务器中碰到错误:Key exchange was not finished, connection is closed.
,导致服务器的连接失败,报错如下
原因
是ssh
中的key
交换算法不兼容导致
解决办法
修改配置文件
vi /etc/ssh/sshd_config
添加如下内容
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,curve25519-sha256@libssh.org
重启服务
service sshd restart
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)