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

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

bash 复制代码
C:\Users\wang>ssh [email protected]
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,[email protected]

这是密钥交换算法不匹配,服务器是较老的、已经被淘汰的算法(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 [email protected]
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 [email protected]
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 [email protected]
sign_and_send_pubkey: no mutual signature supported
[email protected]'s password:

终于可以连了

相关推荐
Levin__NLP_CV_AIGC24 分钟前
更新 / 安装 Nvidia Driver 驱动 - Ubuntu - 2
linux·运维·ubuntu
DLR-SOFT31 分钟前
Windows远程访问Ubuntu的方法
linux·运维·ubuntu
咸鱼2333号程序员1 小时前
Linux ifconfig命令详解
linux·服务器·网络
秦jh_1 小时前
【Linux网络】应用层协议HTTP
linux·运维·服务器·网络·网络协议·tcp/ip·http
何怀逸2 小时前
安装 Docker
运维·docker·容器
杰克逊的日记2 小时前
运维体系架构规划
运维·架构
pp-周子晗(努力赶上课程进度版)3 小时前
【计算机网络-数据链路层】以太网、MAC地址、MTU与ARP协议
服务器·网络·计算机网络
开利网络4 小时前
开放的力量:新零售生态的共赢密码
大数据·运维·服务器·信息可视化·重构
南棱笑笑生4 小时前
20250509让NanoPi NEO core开发板在Ubuntu core16.04系统下实测移远的4G模块EC200A-CN
linux·运维·ubuntu
Python私教4 小时前
Python函数:从基础到进阶的完整指南
java·服务器·python