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


1. 異常


在連接github時,執行”ssh -T git@github.com” 命令時,出現

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

2. 解決方法


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

Host github.com
User YourEmail@163.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

其中User為登錄github的賬號名稱。
再次執行”ssh -T git@github.com”時,會出現提示如下,回車”yes”即可。
這里寫圖片描述
這時驗證就可以通過。
這里寫圖片描述


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM