I have 4 IBM AIX and Linux Servers so when I’m trying to copy the files from one server to another by using scp command it is giving me the below error :
bash-4.2# scp expertisenpuru.txt root@192.168.1.2:/expertisenpuru/test/
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
c5:c4:be:17:7f:53:55:ff:0f:88:11:cd:42:0b:e1:7f.
Please contact your system administrator.
Add correct host key in /.ssh/known_hosts to get rid of this message.
Offending RSA key in /.ssh/known_hosts:10
RSA host key for 192.168.1.2 has changed and you have requested strict checking.
Host key verification failed.
lost connection
As I’m getting the error is related to Host Identification key and may be it got changed or had some issue with him so in order to resolve the issue, I have to check the key or update the correct key in “ssh/known_hosts” file.
So first will check the file to verify that which key is stored in “known_hosts” file.
1.bash-4.2# cat /.ssh/known_hosts
10.1.8.11 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzPZnV1es2lyrUeuP2lvstIMf2WVtT/4ydbU4n7eXuwqVePwhvjODKBthVllRciiQJY+uBBLn8hc2yCXCFKp1XuL+DQ6Ma45/WQAJugHnvCemk0z+zQPYQ4R1yfrr5YsLmiWDWqACpwCsMw+shjvFwbMm+6aZdWJLBoPyiSZSkJSXzlAyNFJRCcY xKf26YCRxYp5lf1zdneR36ZKy2UhHbrbh/MzmVkAOJbX4M8SFTgy5OoR++mXzIRsA8Cw2OLQjSPKwi1A 2Gk0zzCpIyqlO9hy98gV8uZLiQ2gO2keHSoQeFLJgZWkzoIEOo41AnEc/2/K0oWYesLw==
192.168.209.47 ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDMr0Apu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ZTF5Y5Ccc10sBZjO/WmI+867sJ9EDSVUc3KmsQx27mfy1+6YqUpojL9m3irQg+xLBck3vFWiwj4TRZ6G9
As we checked in “known_hosts” file, there is already a my server host identification key is there may be there is some problem with it. So now will edit the file and remove my remote server “192.168.1.2” server key from the file so next time when i’ll try to connect the remote server it’ll automatically fetch the remote host identification key and update in the same file.
follow the below command to edit the file :
2.bash-4.2# vi /.ssh/known_hosts
Now try to copy the file again :
3.bash-4.2# scp expertisenpuru.txt root@192.168.1.2:/expertisenpuru/test/
The authenticity of host ‘192.168.1.2 (192.168.1.2)’ can’t be established.
RSA key fingerprint is c5:c4:be:17:7f:53:55:ff:0f:88:11:cd:42:0b:e1:7f.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.1.2’ (RSA) to the list of known hosts.
root@192.168.209.62’s password:
expertisenpuru.txt 100% 223KB 223.1KB/s 00:00
bash-4.2#
Its work. the new host identification key is got update in the known_hosts file and now i’m able to copy any file to remote host