SSH_Unable to negotiate with 192.168.1.152 port 22: nomatching host host key type found. Their offer
Posted vkelixt
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了SSH_Unable to negotiate with 192.168.1.152 port 22: nomatching host host key type found. Their offer相关的知识,希望对你有一定的参考价值。
操作环境:Kali Linux
终端远程登录ssh时,提示如下错误:
Unable to negotiate with 192.168.1.152 port 22: nomatching host host key type found. Their offer:ssh-dss
由提示得知,ssh不能远程登录的原因为:没有找到相关的主机密钥类型。
1、确实是主机密钥类型不符合
2、不存在相关主机密钥类型
生成ssh_key
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
重启ssh之后远程,问题依然存在
确认密钥已存在......
网络搜索中......
指定主机key算法(最后解决方案):
1、命令中加参数
ssh -o HostKeyAlgorithms=+ssh-dss [email protected]
2、在~/.ssh目录下添加config
vi config
在config中写入以下code:
Host * HostKeyAlgorithms +ssh-dss
3、重启ssh
service ssh restart
Login success !!!
以上是关于SSH_Unable to negotiate with 192.168.1.152 port 22: nomatching host host key type found. Their offer的主要内容,如果未能解决你的问题,请参考以下文章
Unable to negotiate with xxx: no matching MAC found
记录Git Unable to negotiate with xxx... 问题
fiddler 502 System.Security.SecurityException Failed to negotiate HTTPS connection with server.fid
Unable to negotiate with xx.xxx.xxxx port 22: no matching host key type found. Their offer: ssh-rsa(
Unable to negotiate with xxxxport 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss
Unable to negotiate with XXXX port 22: no matching host key type found. Their offer: ssh-rsa,ssh-dss