搜尋

首頁  >  問答  >  主體

git clone 別人的github專案會提示Host key verification failed

git clone git@github.com:Unknwon/qiniudrive.git 失敗! (怎麼回事?)

RSA key fingerprint is xx:xx:xx:xx:xx:xx:xx:xx:xx:xx
Are you sure you want to continue connecting (yes/no)?
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

clone自己的專案不會出現這樣的提示。這是怎麼回事?


git clone git://github.com/Unknwon/qiniudrive.git 成功!

為什麼git@github.com:Unknwon/qiniudrive.git 失敗了? ? ?

伊谢尔伦伊谢尔伦2854 天前934

全部回覆(3)我來回復

  • 阿神

    阿神2017-04-24 09:15:10

    git clone git://github.com/Unknwon/qiniudrive.git 這是使用 git 協定。

    git@github.com:Unknwon/qiniudrive.git 這是使用 ssh 協定。 ssh 會驗證對方伺服器的 key。它沒辦法確認伺服器出示的 key 是受信的,所以問你這個 key 是不是真的是你要連接的那個伺服器的。 你沒說「yes」所以 ssh 認為你不想繼續連接,所以連接失敗。

    回覆
    0
  • 迷茫

    迷茫2017-04-24 09:15:10

    其實這個問題只要 Google 一下就可以解決的。

    雖然可以解決,但其實可以了解一下 git 的大致原理。
    即伺服器上一般是有個 git 的用戶,而你透過 git 用戶去存取專案檔。

    那麼如何透過 git 登入遠端主機取得程式碼?再去看下 ssh 登入。

    而 ssh 的認證有兩種方式,一種是輸入密碼,一種直接 RSA 認證(建議使用 RSA 認證)。在 home 目錄下會有個 .ssh 資料夾,用於存放公鑰,私鑰,known_host,authorized_keys 以及設定檔等。

    ....此處省略一萬字

    具體怎麼解決你的問題,還是希望你能自行 Google 一下。遇到問題先嘗試自己解決,解決不了問 Google ,Google 不到的問題再提會更好。

    回覆
    0
  • 阿神

    阿神2017-04-24 09:15:10

    http://itfan.github.io/#show/2013-06-07-use-github-on-windows

    回覆
    0
  • 取消回覆