出现github 连接错误:

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

刚开始以为是网络问题,github不能连接上,但是使用ssh命令,用端口443测试发现可以连接上github

ssh -T -p 443 git@ssh.github.com

Enter passphrase for key '/root/.ssh/id_rsa':

Hi yinfei1! You've successfully authenticated, but GitHub does not provide shell access.

于是就怀疑端口22不能使用,端口22为ssh默认端口,初步怀疑和github服务器有关,于是将其端口修改为443:

修改方法

切换到 cd ~/.ssh/

进入到~目录下面的.ssh下面,修改ssh配置,新建config文件

将上述文件添加配置:

Host github.com /*服务器地址为github地址*/

User "XXX@XX.com" /*github上的注册邮箱为用户账号*/

Hostname ssh.github.com /*服务器地址为github地址*/

PreferredAuthentications publickey /*采用公匙*/

IdentityFile ~/.ssh/id_rsa /*公匙文件路径*/

Port 443 /*修改端口为443*/

github默认端口22被占用,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: Connection timed out”错误

    在使用Github的时候,如果使用到拉取远端分支的时候或者测试ssh -T git@github.com的时候可能会出现连接失败的问题,错误描述为“ssh: connect to host githu ...

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

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

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

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

  6. 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'... ...

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

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

  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. Git配置非22端口,解决:ssh: connect to host xxx port 22: Connection timed out fatal: The remote end hung up unexpectedly

    背景:私自搭建了Git服务器,而Git本身就是SSH进行连接的,而Git命令上默认只能通过22端口实现. 解决方法: 第一种: 在系统的用户目录下的文件夹:.ssh 如果该路径下没有config文件, ...

随机推荐

  1. ASP.NET Core搭建多层网站架构【14-扩展之部署到IIS】

    2020/02/03, ASP.NET Core 3.1, VS2019, IIS 10, dotnet-hosting-3.1.1-win.exe 摘要:基于ASP.NET Core 3.1 Web ...

  2. Java入门笔记 05-多线程

    介绍:Java提供了非常优秀的多线程支持,程序可以通过非常简单的方式来启动多线程.本章主要内容为:多线程的创建.启动.控制以及同步操作,并介绍JDK 5新增的线程创建方式. 一.线程的创建与使用: 1 ...

  3. spring security 方法权限使用

    前面我们讲过了使用<security:intercept-url>配置url的权限访问,下面我们讲解一下基于方法的权限使用默认情况下, Spring Security 并不启用方法级的安全 ...

  4. 爬虫,工具 - Splash

    What is it? Splash is a javascript rendering service. It's a lightweight web browser with an HTTP AP ...

  5. Java面向对象简单知识总结-考试用

    类.对象.构造器 类定义了属性.方法,是抽象的,写在扩展名为java的文件中. 对象是类的实体,是具体的. 构造器:方法名与类名一致.没有返回类型,可以重载不能重写.在创建对象时调用.使用new调用实 ...

  6. Python学习笔记:变量

    什么是变量? 一般的理解是,变量是一个存储数据的容器 但是在python中的变量只存储数据的引用 变量的特性: 并不直接存储数据,而是引用着某个具体的数据 我们可以人为改变这个引用 定义变量 方式 变 ...

  7. 3000 - No Mycat Database selected

    今天在linux上搭建好mycat后,用Navicat连接出现如下错误 尝试很多方式发现并没有什么用,后面改用SQLyog连接就可以正常使用了!!!

  8. Hive的学习之路(理论篇)

    一.Hive介绍 Apache官网给出的logo,一半是Hadoop大象的头,一半是蜜蜂的身体,也是寓意着它是基于Hadoop,哈哈,纯属个人理解,进入正题. Hive是基于Hadoop的一个数据仓库 ...

  9. PLSQL报错: ORA-12170:TNS connect timeout occurred

    本人的问题已解决,先在安装oracle的服务器上黑窗口输入tnsping,提示说no listener,这是监听服务没有打开. 打开服务后还是不行,最后原因是服务器的网络有防火墙的问题,关掉防火墙连接 ...

  10. 操作系统OS,Python - 协程(Coroutine)

    留坑 参考: https://en.wikipedia.org/wiki/Coroutine https://zh.wikipedia.org/wiki/%E5%8D%8F%E7%A8%8B http ...