当前位置: 首页 > news >正文

Key exchange failed.No compatible key exchange method.

使用远程工具secureCRT (版本:Version 7.0.0 (x64 build 326) ) 连接Linux(Ubuntu-22.04)系统
若20之前的ubuntu系统版本参考::
        🔗使用远程工具连接Linux系统

1、检查ssh-server版本

sudo dpkg -l | grep ssh

打印返回

ii  libssh-4:amd64                             0.9.6-2ubuntu0.22.04.3                  amd64        tiny C SSH library (OpenSSL flavor)
ii  libssh-gcrypt-4:amd64                      0.9.6-2ubuntu0.22.04.3                  amd64        tiny C SSH library (gcrypt flavor)
ii  openssh-client                             1:8.9p1-3ubuntu0.6                      amd64        secure shell (SSH) client, for secure access to remote machines
ii  openssh-server                             1:8.9p1-3ubuntu0.6                      amd64        secure shell (SSH) server, for secure access from remote machines
ii  openssh-sftp-server                        1:8.9p1-3ubuntu0.6                      amd64        secure shell (SSH) sftp server module, for SFTP access from remote machines
ii  python3-paramiko                           2.9.3-0ubuntu1.2                        all          Make ssh v2 connections (Python 3)
ii  ssh-import-id                              5.11-0ubuntu1                           all          securely retrieve an SSH public key and install it locally
Tip:若查询结果没有openssh-server,执行apt install -y openssh-server

2、连接报错

Key exchange failed.
No compatible key exchange method. The server supports these methods: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,sntrup761x25519-sha512@openssh.com,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,kex-strict-s-v00@openssh.com No compatible hostkey. The server supports these methods: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519
报错说:
密钥交换失败。没有兼容的密钥交换方法。列举以下的方法
那就来添加交换密钥的方法

解决方法

vim /etc/ssh/sshd_config

在尾行输入以下内容

HostKeyAlgorithms=+ssh-rsa,ssh-dss
KexAlgorithms=+diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

然后Esc键,输入:wq保存退出,输入以下命令,重启ssh服务

systemctl restart sshd.service

service ssh restart

⛏✔
http://www.lryc.cn/news/331209.html

相关文章:

  • 【FAQ】HarmonyOS SDK 闭源开放能力 —Asset Store Kit
  • arm架构离线部署docker
  • SpringBoot(48)-使用 SkyWalking 进行分布式链路追踪
  • JS实现双向数据绑定的三种方式
  • Bash相关
  • Flink 流批一体在模型特征场景的使用
  • 06-编辑器
  • 5.3.2 实验2:配置交换机端口安全
  • 【AIGC调研系列】通义千问、文心一言、抖音云雀、智谱清言、讯飞星火的特点分析
  • 【JVM】如何定位、解决内存泄漏和溢出
  • 常见网络问题的概述
  • 说说你对数据结构-树的理解
  • Docker实例
  • python基础——模块【模块的介绍,模块的导入,自定义模块,*和__all__,__name__和__main__】
  • 【HTML】标签学习(下.2)
  • os模块篇(十一)
  • 编译amd 的 amdgpu 编译器
  • github 多个账号共享ssh key 的设置方法
  • dm8修改sysdba用户的密码
  • 基于boost准标准库的搜索引擎项目
  • 语言模型进化史(下)
  • 设计模式之旅:工厂模式全方位解析
  • 大数据时代的生物信息学:挖掘生命数据,揭示生命奥秘
  • 微信小程序开发【从入门到精通】——页面导航
  • 嵌入式|蓝桥杯STM32G431(HAL库开发)——CT117E学习笔记15:PWM输出
  • SQLite中的隔离(八)
  • Zabbix6 - Centos7部署Grafana可视化图形监控系统配置手册手册
  • Electron无边框自定义窗口拖动
  • vue3+echarts:echarts地图打点显示的样式
  • vue3从精通到入门7:ref系列