通常发生在重装系统,或IP变更但之前已经登陆过。
这个时候需要打开文件~/.ssh/known_hosts 删除此ip的指纹信息再重新登录,此警告本身是出于安全考虑,避免被中间人攻击。
那怎么配置指定关闭指纹的检查呢。
MacBookPro:~ sunday$ ssh sunday@192.168.77.12
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:Smrhy10B4sJZO9GJPaoYC1XBlsNz0MGFEfidB9nKYW4.
Please contact your system administrator.
Add correct host key in /Users/sunday/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/sunday/.ssh/known_hosts:256
Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
sunday@192.168.77.12: Permission denied (publickey,password).
MacBookPro:~ sunday$ cat ~/.ssh/config
# 所有主机
Host *
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
# 指定
Host 192.168.77.*
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null