ssh no matching key exchange method found错误

我在使用ubuntu2021 ssh 登录另一个系统时出现如下报错:

Unable to negotiate with 192.168.2.1 port 22: no matching key exchange method found. Their offer: diffie-hellman-group1                        4-sha1,diffie-hellman-group1-sha1,kexguess2@matt.ucc.asn.au

我的ubunt版本

#42~20.04.1-Ubuntu SMP Tue Sep 28 20:41:07 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

从网上找了许多方法,最后解决了。

方法一:

ssh -o KexAlgorithms=+diffie-hellman-group1-sha1 root@192.168.2.1

方法二:

修改~/.ssh/config文件加入以下代码,注意是~/.ssh/config,网上有人说修改/etc/ssh/sshd_config,我修改sshd_config文件后并不起作用。

Host *
     KexAlgorithms +diffie-hellman-group1-sha1

重启ssh

service ssh restart

推荐使用第二种方法,因为第二种方法是一劳永逸的。

  • 4
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

alfiy

欢迎请博主喝瓶矿泉水

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值