新版ssh客户端无法连接旧版服务器sshd的方法

新安装完的windows 版本,连Linux服务器直接报错

bash 复制代码
C:\Users\wang>ssh root@192.168.110.50
Unable to negotiate with 192.168.110.50 port 22: no matching key exchange method found. Their offer: diffie-hellman-group14-sha1,diffie-hellman-group1-sha1,kexguess2@matt.ucc.asn.au

这是密钥交换算法不匹配,服务器是较老的、已经被淘汰的算法(diffie-hellman-group14-sha1、diffie-hellman-group1-sha1),而ssh客户端版本较新,禁用了这些不安全的算法。

解决办法:启用不推荐的密钥交换算法:-o KexAlgorithms=+diffie-hellman-group14-sha1,diffie-hellman-group1-sha1

bash 复制代码
C:\Users\wang>ssh -o KexAlgorithms=+diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 root@192.168.110.50
Unable to negotiate with 192.168.110.50 port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss

又报错了,新版ssh客户端无法匹配服务器的旧版密钥类型(ssh-rsa,ssh-dss)

解决办法:启用不推荐的密钥类型 -o HostKeyAlgorithms=+ssh-rsa,ssh-dss

bash 复制代码
C:\Users\wang>ssh -o KexAlgorithms=+diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 -o HostKeyAlgorithms=+ssh-rsa,ssh-dss root@192.168.110.50
Unable to negotiate with 192.168.110.50 port 22: no matching MAC found. Their offer: hmac-sha1,hmac-md5

还是报错,新版ssh客户端无法匹配服务器的消息认证码(MAC)算法。

解决办法:启用不推荐的MAC算法 -o MACs=+hmac-sha1,hmac-md5

bash 复制代码
C:\Users\wang>ssh -o KexAlgorithms=+diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 -o HostKeyAlgorithms=+ssh-rsa,ssh-dss -o MACs=+hmac-sha1,hmac-md5 root@192.168.110.50
sign_and_send_pubkey: no mutual signature supported
root@192.168.110.50's password:

终于可以连了

相关推荐
xiaoxiangsiyan6 小时前
全网IPv6规模化改造实战指南
运维·网络·笔记·云原生·自动化
杨云龙UP7 小时前
Toad for Oracle 调整表空间 Datafile 大小:Usage、Used Pct of Max 与 RESIZE 实战
linux·运维·服务器·数据库·oracle·dba·数据库运维
HiDev_8 小时前
【非标自动化】2、认识元器件(高速计数模块)
运维·自动化
小张同学a.9 小时前
MooseFS 分布式存储实战指南:部署、运维与 Pacemaker+SBD 高可用落地
linux·运维·分布式·pacemaker·moosefs·sbd
Csxyzj9 小时前
Nginx:企业高性能web服务器(一)
运维·服务器·nginx
Eloudy9 小时前
sunshine - ubuntu 22.04, moonlight - mac OS26 远程桌面
linux·运维·ubuntu
旗开得胜马到成功9 小时前
工控系统备份的底层技术解析:老旧协议、零停机窗口与中科热备的专项破局
运维·服务器·vr
AC赳赳老秦9 小时前
企业标签体系搭建:基于 OpenClaw 采集的多维度公开数据,构建企业画像标签库
java·运维·服务器·python·信息可视化·deepseek·openclaw
苍狗T9 小时前
K8s 集群实战:基于 Harbor 私有仓库 + cri‑dockerd 完整部署
linux·运维·云原生·容器·kubernetes
EXI-小洲9 小时前
Docker 容器部署 EMQX|MQTT 消息代理服务安装与配置教程
运维·mqtt·docker·emqx