0

For a github repo I want to update it and I type

git fetch --all

on the command line, but I am always asked

Warning: the ECDSA host key for 'xxx.yyy' differs from the key for the IP address '123.456.789.000'
Offending key for IP in /etc/ssh/ssh_known_hosts:1042
Matching host key in /home/adietz/.ssh/known_hosts:1
Are you sure you want to continue connecting (yes/no)? 

I found similar questions with the solution to remove the offending line from the file

.ssh/known_host

but as soon as I repeat the git command the line is added to .ssh/known_host again, and I am asked over and over again. I even removed the complete file .ssh/known_host without luck.

I am still asked that yes/no question every time.

Is there any way to get rid of this annoyance? Ubuntu 20.04.4

Alex
  • 105
  • 1
  • 2
  • 12
  • Does the key of the server change frequently? Normaly it shouldn't. Are there maybe multiple load balanced servers and you're hitting either one? – TorstenS Apr 06 '22 at 09:59

1 Answers1

1

You are editing the wrong file. The message says that the key found in .ssh/known_hosts is valid, the offending key is in /etc/ssh/ssh_known_hosts. Remove it there.

Gerald Schneider
  • 23,274
  • 8
  • 57
  • 89
  • Ah I see. Yes you are right. fixing is there did solve the problem. The error message is somewhat confusing though... – Alex Apr 06 '22 at 11:02