scp或者ssh报错“no matching host key type found. Their offer- ssh-rsa,ssh-dss“
scp或者ssh报错“no matching host key type found. Their offer: ssh-rsa,ssh-dss“
scp或者ssh报错“no matching host key type found. Their offer: ssh-rsa,ssh-dss“ 原因:OpenSSH 7.0以后的版本不再支持ssh-dss (DSA)算法,查看ssh版本:
ssh -V
解决办法:
在每次指令后加上-oHostKeyAlgorithms=+ssh-dss或者-oHostKeyAlgorithms=+ssh-dsa:
ssh -oHostKeyAlgorithms=+ssh-dsa root@192.168.0.102
(推荐)在~/.ssh目录下修改config文件。(如果是root用户并且没有这个文件夹可以手动创建,亲测有效)如果没有config就创建一个config文件,增加以下内容:
Host *
HostkeyAlgorithms +ssh-rsa
PubkeyAcceptedKeyTypes +ssh-rsa