Linux

為什麼我無法通過 ssh 連接到 github?

  • September 18, 2015

我搜尋了很多,所有找到的解決方案都不起作用。

我通過以下方式生成了 ssh 密鑰:

ssh-keygen -t rsa -b 4096 -C "myemail@gmail.com"

我拿到了鑰匙:

cat /home/drupality/.ssh/id_rsa.pub

我注意到密鑰裡面沒有電子郵件地址,而是我的使用者名(drupality)。

我將密鑰放入 github SSH 密鑰設置。

進口最多:

ssh-add /home/drupality/.ssh/id_rsa

現在我正在嘗試:

ssh git@github.com

輸出:

The authenticity of host 'github.com (192.30.252.130)' can't be
established. RSA key fingerprint is
16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. Are you sure you want
to continue connecting (yes/no)?  Host key verification failed.

我做錯了什麼?

github上有非常好的操作方法:

https://help.github.com/articles/what-are-github-s-ssh-key-fingerprints/

您的按鍵指紋匹配,因此無需擔心書寫yes和按 Enter。

引用自:https://serverfault.com/questions/723407