首页 > 其他 > 详细

github连接报"ssh: connect to host github.com port 22: Connection timed out"错误

时间:2017-12-23 19:49:56      阅读:1128      评论:0      收藏:0      [点我收藏+]

1. 异常


在连接github时,执行”ssh -T git@github.com” 命令时,出现

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 git@github.com”时,会出现提示如下,回车”yes”即可。
技术分享图片
这时验证就可以通过。
技术分享图片

github连接报"ssh: connect to host github.com port 22: Connection timed out"错误

原文:http://www.cnblogs.com/jpfss/p/8094005.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!