$ git push origin master ssh: connect to host github.com port 22: Connection timed out fatal: Could

1.C:\Users\123\.ssh 下創建config文件:

   內容如下:

   Host github.com
   User [email protected]
  Hostname ssh.github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa
  Port 22

2.$ git push origin master
The authenticity of host 'ssh.github.com (192.30.253.123)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)? 

3.//輸入yes,回車

4.C:\Users\123\.ssh 下的known_hosts文件裏面會增加

Permanently added 'ssh.github.com,XXXX' (RSA) to the list of known hosts.

也就是ssh-rsa也服務器git的對應關係;

5.$ git push origin master  成功!

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章