在centos8系统上ssh登录迈普交换机时报错,但在windows+xshell登陆正常,问题应该出在centos 8上。

查资料,openssh从8开始不支持小于1024的密钥了,原因应该和这有关系

[root@test-gaodi ~]# ssh admin@11.1.24.9

ssh_dispatch_run_fatal: Connection to 11.1.24.9 port 22: error in libcrypto

查资料,可以检查下这个选项

[root@test-gaodi ~]# update-crypto-policies --show

DEFAULT

解决办法:

[root@test-gaodi ~]# update-crypto-policies --set legacy

即可继续使用ssh-rsa签名算法的SSH密钥对。

或者 update-crypto-policies --set DEFAULT:SHA1

检查下是否生效

[root@test-gaodi ~]# update-crypto-policies --show

LEGACY

测试ssh连接,已经正常了。

[root@test-gaodi ~]# ssh admin@X.X.X.124

cecloud@X.X.X.124's password:  

Maipu-ISW1#


备注:

如果需要还原centos8默认配置,使用update-crypto-policies --set default