新版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:

终于可以连了

相关推荐
IT小哥哥呀20 小时前
Nginx高可用配置实战:负载均衡 + 健康检查 + 动态扩展
运维·nginx·负载均衡·devops·日志分析·openresty·动态扩展
刘某的Cloud20 小时前
ceph osd down排查
linux·运维·ceph·系统·osd
喜欢你,还有大家1 天前
Docker-仓库-镜像制作
运维·docker·容器
安审若无1 天前
图数据库neoj4安装部署使用
linux·运维·数据库
做运维的阿瑞1 天前
CentOS DNS故障排查完整解决方案:从症状到根因的系统化诊断
linux·运维·centos
深圳市恒讯科技1 天前
英国服务器Windows系统远程桌面安装与优化
运维·服务器·windows
itachi-uchiha1 天前
head和tail命令使用
linux·运维·服务器
violet-lz1 天前
Socket编程实战:从基础API到多线程服务器
运维·服务器
初学者_xuan1 天前
零基础新手小白快速了解掌握服务集群与自动化运维(十六)集群部署模块——LVS-DR&TUN模式配置
运维·自动化·lvs
toooooop81 天前
Nginx 反向代理 HTTPS CDN 配置检查清单(避坑版)
运维·nginx·https·cdn