曹耘豪的博客

连接SSH时确认指纹正确

1
2
3
4
5
> ssh root@xx.xx.xx.xx
The authenticity of host 'xx.xx.xx.xx (xx.xx.xx.xx)' can't be established.
ED25519 key fingerprint is SHA256:qfsPRDdd8sLP+KN6VbnLmzmSRPb6Wj5EJVn3KaBArLE.
This key is not known by any other names.
Are you sure you want to continue connecting (yes/no/[fingerprint])?

我们使用其他方式登录服务器,查看我们服务器的指纹

根据提示,我们要对比使用SHA256摘要的ED25519,执行以下命令查看

1
ssh-keygen -E sha256 -lf /etc/ssh/ssh_host_ed25519_key.pub
1
256 SHA256:qfsPRDdd8sLP+KN6VbnLmzmSRPb6Wj5EJVn3KaBArLE root@xx.xx.xx.xx (ED25519)

对比一致,就可以安全(避免中间人攻击)的建立连接啦

   /