BASH ssh problem - changing SD card OS in Rpi causes this

Now i got to see the hidden files with ls -a

but I can't seem to get into root to find the files that need changing.

Feel very nervous about this, don't want to nuke the OS !

Code:

tim@tim-A880G:~$ ssh -l pi 192.168.1.105
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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 ECDSA key sent by the remote host is
b5:a2:ef:bf:83:61:ae:c0:b2:f4:59:0e:b3:12:8f:ff.
Please contact your system administrator.
Add correct host key in /home/tim/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/tim/.ssh/known_hosts:6
remove with: ssh-keygen -f "/home/tim/.ssh/known_hosts" -R 192.168.1.105
ECDSA host key for 192.168.1.105 has changed and you have requested strict checking.
Host key verification failed.

If by Rpi you mean a Raspberry Pi (or any computer with sshd) the files you want to replicate on your own computers are the "key" files is /etc/ssh. Otherwise those files are uniquely generated the first time you run Raspbian.

You probably need to use sudo to cp those files into place, whether you do that directly to the SD card, or scp them over in your username and then use sudo cp to copy them into /etc/ssh.

On thing you may want to do is install avahi-browser on your Rpi's. Set a different hostname in /etc/hostname and /etc/hosts of each SD card and then you can access them from Ubunu (or Apple or Windows with Bonjour installed) with their hostname.local

key fingerprints

If you changed the OS on the SD card or the SD card itself, the keys in /etc/ssh/ will have changed unless you copied the old ones over onto the new chip or system. If you are confident that the key "b5:a2:ef:bf:83:61:ae:c0:b2:f4:59:0e:b3:12:8f: ff" is the right one, then you can follow the instructions given in the error message to remove the old fingerprint from your local file:

Code:

ssh-keygen -f "/home/tim/.ssh/known_hosts" -R 192.168.1.105

Once you have logged into your server (Rpi) you can double check the key fingerprint with ssh-keygen.