In order to do it I issue the following command:
- Code: Select all
# hostname -I
and get the private ip of the remote server which is 192.168.1.3.
Then I try to establish a ssh connection as follows:
- Code: Select all
# ssh chris@192.168.1.3
This yields the WARNING:
- Code: Select all
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
SHA256:ky5yWZFqIAGYSVrWWJFGviem0S3OUogjVlyyAUTxeHs.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /root/.ssh/known_hosts:1
ECDSA host key for 192.168.1.3 has changed and you have requested strict checking.
Host key verification failed.
Before asking this question on the forum I'd done some searching on the internet and eventually followed one of the solutions I found suggesting that I should remove the offending ECDSA key with
- Code: Select all
# sed -i '1d' ~/.ssh/known_hosts
I'm not sure if that was the right thing to do though cos the problem persisted... I mean I'm still getting the same warning about me being potentially man-in-the-middled but the ~/.ssh/known_hosts file is now empty.
I'm not sure what to do next since I don't quite understand what is causing this issue

Any advice would be greately appreciated.
Thank you.