SSH_Unable to negotiate with … port ..: nomatching host host key type found. Their offer:ssh-rsa

  • Post author:
  • Post category:其他


终端远程登录ssh时,提示如下错误:

Unable to negotiate with 192.168.1.228 port 22: nomatching host host key type found. Their offer:ssh-rsa

ssh不能远程登录的原因为:没有找到相关的主机密钥类型。

解决办法:

1、临时办法——命令中加参数

ssh -o HostKeyAlgorithms=+ssh-rsa user@host

2、永久办法——在~/.ssh目录下添加config

vi config

在config中写入以下code:

Host *
    HostKeyAlgorithms +ssh-rsa

3、重启ssh

service ssh restart