1. 程式人生 > >github連接報"ssh: connect to host github.com port 22: Connection timed out"錯誤

github連接報"ssh: connect to host github.com port 22: Connection timed out"錯誤

body csdn span -s file ckey keyword user class

1. 異常


在連接github時,執行”ssh -T [email protected]” 命令時,出現

ssh: connect to host github.com port 22: Connection timed out
  • 1

2. 解決方法


在存放公鑰私鑰(id_rsa和id_rsa.pub)的文件裏,新建config文本,內容如下:

Host github.comUser YourEmail@163.comHostname ssh.github.comPreferredAuthentications publickeyIdentityFile ~/.ssh
/id_rsaPort 443
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

其中User為登錄github的賬號名稱。
再次執行”ssh -T [email protected]”時,會出現提示如下,回車”yes”即可。
技術分享圖片
這時驗證就可以通過。
技術分享圖片

github連接報"ssh: connect to host github.com port 22: Connection timed out"錯誤