用SSH的跳转登录服务器后,ssh会把你每个你访问过计算机的公钥(public key)都记录在~/.ssh/known_hosts (mac系统).
当下次访问相同计算机时,SSH会核对公钥.如果公钥不同,OpenSSH会发出警告,如果我们重新安装系统,其公钥信息还在,连接会出现问题.如果报错,就需要把known_hosts文件中对应的公钥删除 .
The authenticity of host '172.16.107.9 (172.16.107.9)' can't be established.
ECDSA key fingerprint is SHA256:wv1CCBadfRIKUcK9Jdm/6tRyM7v1Zpu9ebRDc8y66jg.
Are you sure you want to continue connecting (yes/no)?
输入yes
The authenticity of host '172.16.107.9 (172.16.107.9)' can't be established.
ECDSA key fingerprint is SHA256:wv1CCBadfRIKUcK9Jdm/6tRyM7v1Zpu9ebRDc8y66jg.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '172.16.107.9' (ECDSA) to the list of known hosts.
Connection closed by 172.16.107.9 port 22
再次连接
$ ssh root@192.168.1.10
输入密钥
成功