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

相关推荐

  • ubuntu 使用 ifupdown管理网络连接

    由于需要批量永久修改IP,研发提供的脚本是基于修改interfaces的,所以需要使用ifupdown,高版本的ubuntu使用的都是NetworkManager 卸载 NetworkManager 可能会影响你的网络连接配置,因此在卸载之前确保有其他方式管理网络连接。 步骤 1:备份当前配置 在卸载 NetworkManager 之前,最好备份当前的网络配…

    2024年5月21日
    1.1K00
  • find命令排除某些目录或文件

    使用-prune开关。例如,如果要排除misc目录,只需将a添加-path ./misc -prune -o到您的find命令中: find . -path ./misc -prune -false -o -name ‘*.txt’ 这是带有多个目录的示例: find . -type d \( -path dir1 -o -path dir2 -o -pat…

    2023年6月16日
    1.4K00
  • CentOS7系统开机报错:you might want to save “/run/initramfs/rdsosreport.txt“ to a USB stick or /boot…

    一、报错场景我遇到的场景是Centos7强制下电,开机后报错,报错的大致意思是系统文件出现错误 具体报错如下 you might want to save “/run/initramfs/rdsosreport.txt“ to a USB stick or /boot after mounting them and attach it to a bug re…

    2023年10月16日
    1.5K00
  • Centos7系统如何查看系统日志

    Systemd是Linux系统工具,Systemd拥有强大的解决与系统日志记录功能-systemd-journald。日志目录一般是在/var/log/journal,记录的是二进制文件,我们可以通过journalctl进行查看。 日志的配置文件是/etc/systemd/journald.conf。 常用的操作有哪些呢 显示所有日志 查看系统本次启动只有的…

    2022年6月15日
    2.8K00
  • redis 集群 CLUSTERDOWN Hash slot not served 报错解决思路

    背景:  因机房故障,导致redis-cluster 集群中 有个节点 down 了 ,再从新拉起节点加入集群后,就没在意 过来小许,服务器磁盘告警来了,我看了下 应用服务器上的tomcat 的日志,不停的刷,日志内容 报redis 错误, CLUSTERDOWN Hash slot not served 吓得我 立马 去 redis 集群上去 检…

    2023年5月16日
    1.5K00

发表回复

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

在线咨询: QQ交谈

邮件:712342017@qq.com

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

关注微信