Tuesday, 9 February 2021

Offending key for IP for known hosts

 If you are getting below error 


Offending key for IP in /home/path/.ssh/known_hosts:4


This means line 4 in /home/path/.ssh/known_host is bad.


Solution 

 
sed -i '4d' ~/.ssh/known_hosts

Note: Change the 4d according to the line number shown.