ssh update Host Keys
December 26, 2017
To create new ssh keys on the server:
ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N '' -t rsa
ssh-keygen -f /etc/ssh/ssh_host_ecdsa_key -N '' -t ecdsa -b 521
To check the fingerprint:
ssh-keygen -lf ssh_host_ecdsa_key
On the client side:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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:kY/TymCiskD0nhhyWaovohYvfCyZ7ymrEsmujeawaww.
Please contact your system administrator.
Add correct host key in /Users/monkey/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /Users/monkey/.ssh/known_hosts:236
ECDSA host key for [76.9.57.82]:2222 has changed and you have requested strict checking.
Host key verification failed.
To see the key on line 236:
awk 'NR==236' know_hosts
To remove the key:
ssh-keygen -R "[76.9.57.82]:2222"
Try to ssh again and veriy the key matches the one on the server.