在使用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. 用 JS 设置图片的最大宽度

    //用 JS 设置图片的最大宽度    function setImgsMaxWidth() {        $('.answerimg img').each(function () {       ...

  2. 架构探险笔记4-使框架具备AOP特性(上)

    对方法进行性能监控,在方法调用时统计出方法执行时间. 原始做法:在内个方法的开头获取系统时间,然后在方法的结尾获取时间,最后把前后台两次分别获取的系统时间做一个减法,即可获取方法执行所消耗的总时间. ...

  3. Weighted Channel Dropout for Regularization of Deep Convolutional Neural Network

    这是AAAI2019的一篇论文,主要是为了解决小数据集的过拟合问题,使用了针对于卷积层的Dropout的方法. 论文的要点记录于下: 1.在训练过程中对于卷积层的channels进行droipout, ...

  4. 用swoole简单实现MySQL连接池

    MySQL连接池 在传统的网站开发中,比如LNMP模式,由Nginx的master进程接收请求然后分给多个worker进程,每个worker进程再链接php-fpm的master进程,php-fpm再 ...

  5. 78. Subsets C++回溯法

    本题还是基本的回溯法.就是回溯函数的参数选择上要花点心思! class Solution { public: void backTrack(vector<int> ans, vector& ...

  6. 13. Roman to Integer C++

    直接for循环,并且判断是否出现IV等情况 int which(char ch) { if(ch == 'I') ; else if(ch == 'V') ; else if(ch == 'X') ; ...

  7. 这些你都了解么------程序员"跳槽"法则

    篇头语: “跳槽”这个词是从我报了"软件工程"这个专业后就已经开始听说的词了, 在大学中老师上课也会常说:“等你们参加工作以后,工资低不怕,没事就跳槽,之后工资就高了”: 我相信听 ...

  8. Qt_Pro详解

    在QT中,有一个工具qmake可以生成一个makefile文件,它是由.pro文件生成而来的,.pro文件的写法如下: 1. 注释 从“#”开始,到这一行结束. 2.模板变量告诉qmake为这个应用程 ...

  9. burpsuite只拦截特定网站数据包教程

    一.背景说明 在配置burpsuite代理截包时经常会遇到这样的情况: 浏览器经常自己发一些包(收集用户信息),干挠渗透测试人员对目标网站的检测: 如果是代理手机,那就是很多APP都时不时发一些包,干 ...

  10. Find a way out of the ClassLoader maze

    June 6, 2003 Q: When should I use Thread.getContextClassLoader() ? A: Although not frequently asked, ...