Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
127
rated 0 times [  127] [ 0]  / answers: 1 / hits: 87024  / 2 Years ago, mon, october 10, 2022, 11:17:43

I've done tons of search and tested different solutions, but gain no success!



When I want to push my codes, I receive the following error:



Warning: the ECDSA host key for 'git.mywebsite.ir' differs from the key for the IP address '164.138.23.11'
Offending key for IP in /home/alireza/.ssh/known_hosts:10
Matching host key in /home/alireza/.ssh/known_hosts:1
Are you sure you want to continue connecting (yes/no)? yes


What should I do to remove this message every time I push my changes? Any idea?



key list


More From » ssh

 Answers
3

It says:




Offending key for IP in /home/alireza/.ssh/known_hosts:10




So for some reason you have to delete 10-th line in known_hosts.



Run this command to delete 10-th line in known_hosts:



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


Or use ssh-keygen



ssh-keygen -R git.mywebsite.ir


Quote from man




 -R hostname
Removes all keys belonging to hostname from a known_hosts file.
This option is useful to delete hashed hosts (see the -H option
above).


[#25660] Wednesday, October 12, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
diket

Total Points: 167
Total Questions: 124
Total Answers: 109

Location: Somalia
Member since Wed, Mar 15, 2023
1 Year ago
;