When I am trying to transfer files using SCP command I'm getting this error (Removed my IP and RSA key):
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 the RSA host key has just been changed.
The fingerprint for the RSA key sent by the remote host is
------------------------(RSA key)
Please contact your system administrator.
Add correct host key in /home/users/myaccount/.ssh/known_hosts to get rid of this message.
Offending key in /home/users/myaccount/.ssh/known_hosts:4
RSA host key for 'my IP' has changed and you have requested strict checking.
Host key verification failed.
lost connection
I am using newly installed Ubuntu 12.04 and I can connect to this server using ssh. Any help?
This can easily happen when connecting to a computer who's host keys in /etc/ssh have changed if that computer was upgraded without copying its old host keys. The host keys here are proof when you reconnect to a remote computer with ssh that you are talking to the same computer you connected to the first time you accessed it.
If the remote computer is within your control you probably know if it was updated and the host keys not copied. If so, and if the system is on your LAN you can be pretty safe in ignoring or circumventing this error message. You probably know its IP address with certainty and know there are no trojan devices on it.
If the computer is not within your control but you are certain that it has been upgraded it may also be reasonable to circumvent this error message. (If the remote host publishes the hashes of its ssh host keys you may be able to check these to be safer, or you can call the server's management to obtain the host key fingerprint).
If the computer is within your control you should copy the old host keys from /etc/ssh to the new system as part of your upgrade procedure. (N.B. there are both key files and configuration files in this directory.)
Once you know you want to ignore this condition there are at least 2 ways to deal with this issue.
ssh -o 'StrictHostKeyChecking no' user@host
You'll have to do this each time. Or ...
sed -i '4d' /home/users/myaccount/.ssh/known_hosts
This is the more permanent solution. Instead of giving you the above message you will be given the option to accept the new hostkey from the server, just as you did the very first time you connected to it. Verify the best you can that you are connecting to the correct remote computer, without going through an intermediary, and then accept the new host key.
You have to remove the 4th ssh key from
/home/users/myaccount/.ssh/known_hosts
file.It seems that you copied your ssh-folder from an old system to your new one.
Open terminal and type in:
This will delete all the "old" keys.