SSH 协议不匹配
错误信息:
Unable to negotiate with 10.168.1.1 port 22: no matching host key type found. Their offer: ssh-rsa
解决方法:
- 对于
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
- 对于
ssh
命令:
ssh -o HostkeyAlgorithms=+ssh-rsa -o PubkeyAcceptedAlgorithms=+ssh-rsa [email protected]
- 修改 SSH 配置文件(
~/.ssh/config
):
编辑或创建 ~/.ssh/config
文件,并添加以下内容:
Host 10.168.1.1
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms +ssh-rsa
然后保存文件。
请根据以上方法之一进行测试,以解决 SSH 协议不匹配的问题。
评论区