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 user@host

2、在~/.ssh目录下添加config  

vi config

  在config中写入以下code:

Host *
    HostKeyAlgorithms +ssh-dss

3、重启ssh

service ssh restart

  

Login success !!!

转载于:https://www.cnblogs.com/VkeLixt/p/9978997.html

你可能感兴趣的:(SSH_Unable to negotiate with 192.168.1.152 port 22: nomatching host host key type found. Their offer...)