Wednesday, April 8, 2020

Miration issues: After migration done, we could not able to ssh to the server due to the changes on the /.ssh/known_hosts in aix?

Miration issues: After migration is done, we could not able to ssh to the server due to the changes in the /.ssh/known_hosts in aix?


 
After the server migrated, we could not ablet o ssh the server due to the changes on the /.ssh/known_hosts during the migration, this situation would happen especially on the cluster environment. In order to fix this, you have to follow the error message as the solution is mentioned in the error messages clearly.

testlpar1: # ssh root@testlpar2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
SHA256:Qx5ofuasgihsknglisidghi4gosidgnog/LQg.
Please correct your system administrator.
Add correct host key in /.ssh/known_hosts to get rid of this message.
Offending DSA key in /.ssh/known_hosts:3
RSA host key for tesetlpar2 has changed and you have requested strict checking.
Host key verification failed.
testlpar1: #


Solution
=======

In the above errors, it clearly says that we need to correct the host key in /.ssh/known_hosts and it also provide the solution like "offending DSA key in /.ssh/known_hosts:3" which means
that you need to comment out the third (3) lines on the /.ssh/known_hosts using vi editor.

cp -p /.ssh/known_hosts /.ssh/known_hosts_backup
vi /.ssh/known_hosts   (comment out the 3rd line)

The first time it asks the yes/no confirmation, next time onwards it won't ask. (directly logon to the servers)