zcw@ZCWmac ~ % ssh h3c@192.168.101.2
Unable to negotiate with 192.168.101.2 port 22: no matching host key type found. Their offer: ssh-rsa
因为OpenSSH7.0以后的版本不再支持ssh-dss(DSA)算法,官方的说法是这个算法太弱了。
zcw@ZCWmac ~ % ssh -V
OpenSSH_9.1p1, OpenSSL 1.1.1s 1 Nov 2022
当前版本9.1,需要在~/.ssh/config文件中增加支持rsa
nano ~/.ssh/config
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa
完美解决!