2014-01-13 83 views
10

我有我們的生產服務器的根訪問權限,我想部署最新版本的git到服務器,但我遇到了下面的錯誤,當我「 git pull「在我想要更新的文件夾上。不能「混帳拉」 - 主機密鑰驗證失敗

我瀏覽了一下週圍,但無法找到該怎麼做了明確的答案..

登臺服務器在同一臺機器上運行,只是在不同的文件夾,當我pull上該文件夾一切正常。

我當談到Linux的我不是很有經驗,所以請幫助我如何修復:-)

否則我要什麼我訪問需要

附言:一個明確的答案 這在過去的工作,所以我假設它得到的東西做的SSH密鑰

錯誤:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
@  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. 
+2

你有沒有嘗試過'ssh-keygen -f「/root/.ssh/known_hosts」-R gitlab.site.org'? – fedorqui

+2

哎呀,那太容易了。謝謝@fedorqui。我確實看到了那裏的文本行,但主服務器管理員現在正在離開,現在必須部署,所以刪除ssh信息似乎有點冒險。做了文件的備份,做了你所說的並再次運行git pull。現在一切正常 – Richard

回答

25

在日誌中看到以下文字:

 
(...) 

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. 

所以這是一個執行命令的問題,在那裏建議:

ssh-keygen -f "/root/.ssh/known_hosts" -R gitlab.site.org 
+1

像魅力一樣工作! – Richard

+0

很高興爲你效力,@理查德:) – fedorqui

+2

+1解決這個問題的最好方法。另一種方法是刪除'〜/ .ssh/known_hosts'中的gitlab.site.org條目。 @Richard,也試圖調查爲什麼密鑰已經改變,因爲大部分時間他們不應該改變。 –

11

窗口:

  1. 轉到/Users/Abhilash/.ssh/known_hosts並在其中刪除內容並保存。

Ubuntu的:

  1. 轉到~/.ssh/
  2. 納米的known_hosts
  3. 刪除內容並保存ctrl+O

注: 您將promted再次按下時保存密鑰。

相關問題