连接linux远程主机时,偶然遇到ssh客户端不支持ssh-rsa算法导致失败,报错内容如下:
1 |
Unable to negotiate with 10.10.10.100 port 22: no matching key exchange method found. Their offer: diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1 |
解决方案
新建文件~/.ssh/config,添加以下内容:
1 2 3 4 |
Host * KexAlgorithms +diffie-hellman-group1-sha1 HostkeyAlgorithms +ssh-dss,ssh-rsa PubkeyAcceptedKeyTypes +ssh-dss,ssh-rsa |
保存文件,再次ssh连接远程主机,成功。
原创文章禁止转载:技术学堂 » 解决ssh客户端不支持ssh-rsa算法的故障