ssh连接服务器错误:remote host identification has changed

it2023-06-04  78

问题

在连接服务器的时候,显示错误:remote host identification has changed。

这是因为服务器的公钥发生了改变,当我们使用ssh连接服务器的时候,使用原来的公钥去验证,所以出现了以上错误。

解决

那么我们需要把本地保存的原来服务器的公钥信息给删掉,(公钥保存的文件路径为/root/.ssh/known_hosts): ssh-keygen -R 服务器ip -f /root/.ssh/known_hosts

再次使用ssh命令连接即可

最新回复(0)