Unable to negotiate with 192.168.10.128 port 20001: no matching host key type found. Their offer: ssh-dss,ssh-rsa

根本原因之所以报错是因为OpenSSH7.0以后的版本不再支持ssh-dss(DSA)算法,官方的说法是这个算法太弱了。MACOS升到10.12附带的openssh
版本是7.4,如下:➜~sshd-Vsshd:illegaloption--VOpenSSH_7

方案一 命令行添加选项 `ssh -oHostKeyAlgorithms=+ssh-dss user@host -p port`

示例:

sftp -P 20001 -oHostKeyAlgorithms=+ssh-dss test@192.168.10.128

在ssh的配置文件中添加全局选项

HostKeyAlgorithms +ssh-dss

- 添加到配置 ~/.ssh/config

- 添加到 /etc/ssh/ssh_config

LINUX随笔十 SFTP不支持 ssh-dss,ssh-rsa_清晨的技术博客_51CTO博客

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐