Key exchange was not finished, connection is closed.解决办法

利用java连接Linux服务器中碰到错误:Key exchange was not finished, connection is closed.,导致服务器的连接失败,报错如下

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

文章来源:https://www.cnaaa.net,转载请注明出处:https://www.cnaaa.net/archives/9198

(0)
郭靖的头像郭靖
上一篇 2023年7月25日 下午4:22
下一篇 2023年7月26日 下午4:13

相关推荐

  • 安装 Smem – Linux工具 安装条件: 现代内核 (版本号高于 2.6.27) 较新的 Python 版本 (2.4 及以后版本) 可选的 matplotlib 库用于生成图表 对于当今的大多数的 Linux 发行版而言,内核版本和 Python 的版本都能够满足需要,所以仅需要为生成良好的图表安装 matplotlib 库。 RHEL,…

    2023年8月25日
    1.4K00
  • Centos7.6下SSH服务默认端口修改

    一般服务端的ssh端口默认是22,我们可以通过修改服务端的ssh配置文件,来修改ssh访问服务端的端口号 1、连接linux服务器 2、用编辑器(Vim,Emacs,Nano…)打开服务器上的/etc/ssh/sshd_config文件 vi /etc/ssh/sshd_config 2、修改对应位置的端口为你想要端口,修改完成后先按ESC键,再按shift…

    2022年6月8日
    1.6K00
  • 解决crond引发大量sendmail、postdrop进程导致内存使用过大问题

    现象:客户反馈机器卡顿,上面只运行了一个宝塔,疑似中了木马 分析过程:top发现内存使用过高,ps -aux发现大量postdrop、sendmail、crond进程,而postdrop是由sendmail启动的,sendmail是由crond启动的。 crond在执行脚本时会将脚本输出信息以邮件的形式发送给系统用户,所以必然要调用sendmail,而sen…

    2022年12月6日
    2.0K00
  • smokeping修改Ping间隔和Ping包数量

    1、复制 所有带*.dist 2、修改httpd.conf 配置文件 3、修改 /usr/local/smokeping/etc/config

    2022年11月26日
    1.5K00
  • Linux 修改系统时间的两种方式

    我们一般使用“date -s”命令来修改系统时间。比如将系统时间设定成2010年4月5日的命令如下。 [root@rhel ~]# date -s 20100405 Mon Apr  5 00:00:00 CST 2010 将系统时间设定成14点31分0秒的命令如下 [root@rhel ~]# date -s 14:31:00 Mon Apr&n…

    2023年7月27日
    1.3K00

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

在线咨询: QQ交谈

邮件:712342017@qq.com

工作时间:周一至周五,8:30-17:30,节假日休息

关注微信