情况1
如果机器A没被机器B通过ssh连接过,那么再次连接时会出现
The authenticity of host '192.168.1.83 (192.168.1.83)' can't be established.
ECDSA key fingerprint is SHA256:hI1xSDX6io5FAw427eFMCSP3aQIJSZwe4PKMDdDoSps.
Are you sure you want to continue connecting (yes/no/[fingerprint])?
只要输入yes,就可以连接机器A对其进行命令行控制
情况2
如果机器A被机器B通过ssh连接过,机器A重装系统了,那么再次连接就会出现
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ECDSA key sent by the remote host is
SHA256:hI1xSDX6io5FAw427eFMCSP3aQIJSZwe4PKMDdDoSps.
Please contact your system administrator.
Add correct host key in C:\\Users\\D/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in C:\\Users\\D/.ssh/known_hosts:2
ECDSA host key for 192.168.1.83 has changed and you have requested strict checking.
Host key verification failed.
翻译过来就是机器B已经有机器A的密匙了,但是由于机器A密匙更新了,所以连不上了,直接去指定目录下把机器B的密匙删了,再连接就可以了。
情况3
如果机器A是ubuntu,只需要执行
ssh-keygen -f "/home/ubuntu/.ssh/known_hosts" -R "192.168.1.99" # 后面ip换成对应ip即可