[HowTo]avoid message “remote host identification has changed" happen when using ssh to connect new host.

By | 2019-08-13

When ssh new host ,it will show following message as default.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
..blahblah

Of course you can choice YES to accept new host’s fingerprint key.
But that’s really annoying when connect to new virtual machine.
Here is my way to avoid this situation.
(My OS is Ubuntu 16.04)
To modify /etc/ssh/ssh_config as following:
Host *
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
Host 192.168.0.*
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null
Host 172.16.*.*
StrictHostKeyChecking no
UserKnownHostsFile=/dev/null

This change mean for all host is need to check fingerprint ,but it’s not to check for 192 and 172.

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *