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

相关推荐

  • 在Linux中执行yum命令失败,提示“HTTP Error 404 -Not Found Trying other mirror”错误怎么办?

    问题描述 在Linux系统的ECS实例中执行yum命令(如yum -y install XXX、yum list、yum search XXX等)失败,出现类似如下错误信息。 问题原因 出现该问题可能有以下原因: 解决方案 切换CentOS 6/8的源地址 CentOS 6与CentOS 8操作系统版本结束了生命周期(EOL),Linux社区已不再维护该操作…

    2023年11月28日
    96700
  • Prometheus 监控进程

    prometheus 进程的监控 1. process exporter功能 2. 监控目标对主机进程的监控,chronyd sshd 等服务进程已经已定义脚本运行程序的运行状态监控。 process-compose的安装 监控所有进程 监控指定进程 docker 运行 docker ps -a 确认 up http://10.19.1.220:9256/m…

    2024年1月4日
    1.1K00
  • HTTPS 下使用WebSocket的一些实践

    问题描述: HTTPS 下发起WS连接,连接失败,Chrom 浏览器报错。 socket.js:19 Mixed Content: The page at ‘https://app.XXX.com’ was loaded over HTTPS, but attempted to connect to the insecure WebSocket endpoi…

    2023年1月20日
    1.2K00
  • /etc/security/limits.conf配置文件详解

    /etc/security/limits.conf 是一个用于配置用户或用户组资源限制的配置文件。这个文件通常用于设置系统资源的软限制和硬限制,以及一些特殊权限。 一. limits.conf常见配置项详解 下面是一些 /etc/security/limits.conf 文件中可能包含的常见配置项: 描述 第一列表示用户和组(@开头),这里的 * 代表所有用…

    2024年5月14日
    1.3K00
  • 提高终端生产力神器 – tmux

    tmux github 一键安装 centos 系列可以直接用 yum debian 系列可以直接用 apt-get 编译安装 编译 libevent 编译 tmux 编译 tmux 还需要用到 ncurses 验证 tmux 是不是可用 如果出现报错:tmux: error while loading shared libraries: libevent_…

    2023年11月10日
    1.2K00

发表回复

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

在线咨询: QQ交谈

邮件:712342017@qq.com

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

关注微信