侧边栏壁纸
博主头像
DOKI SEKAI博主等级

行动起来,活在当下

  • 累计撰写 114 篇文章
  • 累计创建 38 个标签
  • 累计收到 1 条评论

目 录CONTENT

文章目录

SSH 协议不匹配

君
2024-07-15 / 0 评论 / 0 点赞 / 52 阅读 / 2108 字

SSH 协议不匹配

错误信息:

Unable to negotiate with 10.168.1.1 port 22: no matching host key type found. Their offer: ssh-rsa

解决方法:

  1. 对于 scp 命令
scp -o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa /Users/snz/Downloads/openwrt-ramips-mt7621-oraybox_x3a-squashfs-sysupgrade_20220425_190458.bin [email protected]:/tmp/new_filename.bin
  1. 对于 ssh 命令
ssh -o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa [email protected]
  1. 修改 SSH 配置文件(~/.ssh/config

编辑或创建 ~/.ssh/config 文件,并添加以下内容:

Host 10.168.1.1
    HostkeyAlgorithms +ssh-rsa
    PubkeyAcceptedAlgorithms +ssh-rsa

然后保存文件。


请根据以上方法之一进行测试,以解决 SSH 协议不匹配的问题。

0

评论区