问题原文
原帖链接 · alexus · CC BY-SA 3.0
Is there a way to temporarily ignore my ~/.ssh/known_hostsfile?
mbp:~ alexus$ ssh 10.52.11.171
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 RSA key sent by the remote host is
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Please contact your system administrator.
Add correct host key in /Users/alexus/.ssh/known_hosts to get rid of this message.
Offending RSA key in /Users/alexus/.ssh/known_hosts:155
RSA host key for 10.52.11.171 has changed and you have requested strict checking.
Host key verification failed.
mbp:~ alexus$
NOTE:
.. by a few answer(s)/comment(s) i realize that my question is a bit misleading, so short it is expected behavior), so it's normal (in my case) there is a valid reason behind it on why I want to see "ignore it")
社区高分解答
原帖链接 · MattB · CC BY-SA 3.0
To completely ignore your known hosts file in a POSIX environment, set the GlobalKnownHostsFile and UserKnownHostsFile options to /dev/null:
ssh -o GlobalKnownHostsFile=/dev/null -o UserKnownHostsFile=/dev/null user@host
Setting the StrictHostKeyChecking=no option will allow you to connect but SSH will still show a warning:
ssh -o StrictHostKeyChecking=no user@host
As others have noted, it's probably better to address the underlying issue. You could consider SSH certificate authentication to verify hosts, for example.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
