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

相关推荐

  • Zabbix 监控SSL证书到期时间

    监控脚本: [root@fxkj devops]# vim /home/zabbix/etc/zabbix_agentd.conf.d/check_ssl.sh #!/bin/bash #获取证书的有效时间 time=$(echo | openssl s_client -connect $1:443 2>/dev/null | openssl x509…

    2023年3月6日
    1.6K00
  • CentOS 6 yum安装软件报错 YumRepo Error

    在CentOS 6的机器上使用yum 安装软件报错: 使用yum update命令也是一样: 看错误提示,似乎是说找不到有效的baseurl。所以要解决这个问题,还要从baseurl着手。从官方邮件可知,CentOS 6自从2020年11月30日开始,官方不再维护,所以连带着原来的yum存储库也不能用了。 但是邮件里说得很明白,它给出了迁移后的存储库的链接地…

    2023年5月25日
    96800
  • crontab中反引号和$()无效的解决

    问题描述 1.增加了一条crontab,删除本月中2天以前的日志 10 02  * * * /bin/find /data/logs/php/$(date  +%Y%m)/ -mtime +2 | xargs rm -rf   可是看上面的crontab总是运行失败,然后查/var/log/cron 日志报 Jul 22 02:02:01  loc…

    2023年3月29日
    1.1K00
  • MySQL5.7主从同步、读写分离

    MySQL5.7主从同步、读写分离 安装MySQL5.7 下载rpm包 安装 启动mysql查看密码 登录mysql 主从同步 关闭每台服务器的防火墙和selinux 主从服务器时间同步 主服务器使用本地时钟源 修改配置文件 开启ntpd 从服务器同步主服务器时间 安装ntp工具 启动ntp和主服务器进行时间同步 主服务器mysql配置 修改配置文件 重启m…

    2022年7月31日
    1.7K00
  • VMware虚拟机安装Ubuntu24.04教程

    (一)Ubuntu镜像文件下载(选择Ubuntu桌面版)1、Ubuntu官方网站(1)Ubuntu官网:https://ubuntu.com(2)Ubuntu官网中文站:https://cn.ubuntu.com(3)Ubuntu24.04桌面端官方下载:https://ubuntu.com/blog/ubuntu-desktop-24-04-noble-n…

    2024年5月31日
    2.2K00

发表回复

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

在线咨询: QQ交谈

邮件:712342017@qq.com

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

关注微信