每当您连接到未知主机时 ssh 都会提示您
The authenticity of host '...' can't be established.
RSA key fingerprint is ...
Are you sure you want to continue connecting (yes/no)?
Run Code Online (Sandbox Code Playgroud)
并在文件known_hosts
文件中添加一个新条目。
因此,要重新生成文件,请连接到您常用的主机,如果您怀疑存在 MITM,则可选择检查指纹。