在使用Github的时候,如果使用到拉取远端分支的时候或者测试ssh -T git@github.com的时候可能会出现连接失败的问题,错误描述为“ssh: connect to host github.com port 22: Connection timed out”,这个是由于链接Github相应端口的时候出错。解决方案由两个

方法一:

在克隆项目的时候使用git clone https://xxxx,避开使用git clone git@github.com/xxx

方法二:

在id_rsa同级目录下新建config文本文件,并写入如下代码

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

 强制将git协议修改为https的443端口,

建议使用方法二,新建文件之后,新开git bash窗口,然后使用ssh -T git@github.com查看连接状态,出现如下信息就标识已经成功设置了。

Github拉取远端的时候提示“ssh: connect to host github.com port 22: Connection timed out”错误的更多相关文章

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

    方案1(本人使用此方案,问题得已解决): 可能是ssh-server未安装或者未启动.我的ubuntu 12.04 默认只安装了openssh-client,并没有安装server. 运行 ps -e ...

  2. 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: ...

  3. GitHub上传不了的解决 ssh: connect to host github.com port 22: Bad file number git did not exit cleanly (exit code 128)

    问题情况 本来一直用的是github的客户端,结果现在上传的时候出问题了,去网站上看,新项目已经创建,但是代码却怎么都上传不上去.于是只好用命令行的方式解决. Tortoisegit上是这样说的: g ...

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

    问题描述 $ git clone git@github.com:MaugerWu/MaugerWu.github.io.git Cloning into 'MaugerWu.github.io'... ...

  5. git clone遇到的[ssh: connect to host github.com port 22]

    起因 在学习递归的时候,对汉诺塔小研究了一番,参考网上写了个demo,后面就想同步到github. 过程 这台电脑是新电脑,所以需要先本地生成ssh key:ssh-keygen -t rsa -C ...

  6. ssh: connect to host github.com port 22: Connection refused

    假设git例如,下面的问题时,远程推送: [fulinux@ubuntu learngit]$ git push -u origin master ssh: connect to host githu ...

  7. github默认端口22被占用,ssh: connect to host github.com port 22: Connection timed out

    出现github 连接错误: ssh:connect to host github.com port 22:Connection timed out 刚开始以为是网络问题,github不能连接上,但是 ...

  8. 关于github报错:ssh: connect to host github.com port 22: Connection timed outfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.

    当执行git命令如:git clone.git pull等等 出现报错:ssh: connect to host github.com port 22: Connection timed outfat ...

  9. $ ssh -T git@github.com ssh: connect to host ssh.github.com port 22: Connection timed out

    在C:/用户/用户名/.ssh中添加几个文件 之前的电脑生成都是四个文件,分别是 id_rsa  id_rsa.pub  config known_hosts 不知道为什么在另一台电脑上却生成两个文件 ...

随机推荐

  1. 20171104xlVBA制作联合成绩条

    Dim dGoal As Object Dim dCls As Object Sub 制作联合成绩条() Dim sht As Worksheet Dim HeadRng As Range Dim H ...

  2. vue 点击一个div,使input获得焦点

    <div class="inputMessage" @click="inputMessage">输入留言</div> <input ...

  3. php根据时间显示刚刚,几分钟前,几小时前的实现代码

    发布时间距现在的时间 function tranTime($time) { $rtime = date("m-d H:i", $time); $htime = date(" ...

  4. addEventListener调用带参数函数

    当传递参数值时,使用"匿名函数"调用带参数的函数: <body> <button id="btn">click me</butto ...

  5. ImportError: sys.meta_path is None, Python is likely shutting down

    python执行过错中,报错:ImportError: sys.meta_path is None, Python is likely shutting down 解决方法:在C:\Users\Adm ...

  6. 『Github』简易使用指南

    一.新建repository 新建项目从下图位置开始, 当我们完成了初始化后,找不到创建/上传文件的位置,只需如下操作, 然后, 即可,当然,按照下图提示进行命令行操作实际是一样的, 创建了READM ...

  7. Python图片缩放

    from PIL import Image def size(jpg,now_size): im = Image.open(jpg) width, height = im.size if width& ...

  8. spring boot(一)入门

    什么是spring boot Spring Boot是由Pivotal团队提供的全新框架,其设计目的是用来简化新Spring应用的初始搭建以及开发过程.该框架使用了特定的方式来进行配置,从而使开发人员 ...

  9. Leetcode 993. 二叉树的堂兄弟节点

    993. 二叉树的堂兄弟节点  显示英文描述 我的提交返回竞赛   用户通过次数195 用户尝试次数229 通过次数195 提交次数462 题目难度Easy 在二叉树中,根节点位于深度 0 处,每个深 ...

  10. Node.js的环境搭建

    Node.js 可以理解为服务端的JavaScript.是基于Chrome JavaScript 运行时的一个平台. 是一个事件驱动I/O,基于Google V8 引擎,执行起来速度特别快,性能非常好 ...