Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to "git pull" - Host key verification failed

Tags:

I've got root access to our production server and I want to deploy the latest version in git to the server but I'm running into the error below when I "git pull" on the folder I want to update.

I've browsed around a bit, but can't find a clear answer on what to do..

The staging server runs on the same machine, but just in a different folder and when I pull on that folder it all goes fine.

I'm not very experienced when it comes to Linux, so please help me out with a clear answer on how to fix :-)

Otherwise I have access to anything I need

p.s. This has worked in the past, so I'm assuming it's got something to do with the SSH key

Error:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The ECDSA host key for www.site.org has changed,
and the key for the corresponding IP address x.x.x.x
is unknown. This could either mean that
DNS SPOOFING is happening or the IP address for the host
and its host key have changed at the same time.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
*************
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
  remove with: ssh-keygen -f "/root/.ssh/known_hosts" -R gitlab.site.org
ECDSA host key for gitlab.site.org has changed and you have requested strict checking.
Host key verification failed.
like image 803
Richard Avatar asked Jan 13 '14 09:01

Richard


People also ask

What does host key verification failed mean?

The host key verification error occurs when the key of the remote server changes and client does not verify it from the stored keys.

What is host key verification?

Host key verification is a process verifying the remote host identity. Host Keys are stored on the SSH Server under /etc/ssh/ and are used to identify the server (Jenkins agents acts as SSH Servers)

What does ssh Keyscan do?

ssh-keyscan is a command for gathering the public host keys for a number of hosts. It aids in building and verifying ssh_known_hosts files. ssh-keyscan provides a minimal interface suitable for use by shell and Perl scripts.


Video Answer


1 Answers

In the log you see the following text:

(...)

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
remove with: ssh-keygen -f "/root/.ssh/known_hosts" -R gitlab.site.org
ECDSA host key for gitlab.site.org has changed and you have requested strict checking.
Host key verification failed.

So it is a matter of performing the command that is suggested there:

ssh-keygen -f "/root/.ssh/known_hosts" -R gitlab.site.org
like image 111
fedorqui 'SO stop harming' Avatar answered Sep 21 '22 08:09

fedorqui 'SO stop harming'