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不能连接上,但是使用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的更多相关文章
- ssh: connect to host gihub.com port 22: Connection timed out
方案1(本人使用此方案,问题得已解决): 可能是ssh-server未安装或者未启动.我的ubuntu 12.04 默认只安装了openssh-client,并没有安装server. 运行 ps -e ...
- 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: ...
- Github拉取远端的时候提示“ssh: connect to host github.com port 22: Connection timed out”错误
在使用Github的时候,如果使用到拉取远端分支的时候或者测试ssh -T git@github.com的时候可能会出现连接失败的问题,错误描述为“ssh: connect to host githu ...
- GitHub上传不了的解决 ssh: connect to host github.com port 22: Bad file number git did not exit cleanly (exit code 128)
问题情况 本来一直用的是github的客户端,结果现在上传的时候出问题了,去网站上看,新项目已经创建,但是代码却怎么都上传不上去.于是只好用命令行的方式解决. Tortoisegit上是这样说的: g ...
- ssh: connect to host github.com port 22: Connection refused
假设git例如,下面的问题时,远程推送: [fulinux@ubuntu learngit]$ git push -u origin master ssh: connect to host githu ...
- 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'... ...
- git clone遇到的[ssh: connect to host github.com port 22]
起因 在学习递归的时候,对汉诺塔小研究了一番,参考网上写了个demo,后面就想同步到github. 过程 这台电脑是新电脑,所以需要先本地生成ssh key:ssh-keygen -t rsa -C ...
- 关于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 ...
- 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文件, ...
随机推荐
- Linux - 删除文件的正确方式
mv <file> /tmp/ cp <file> /opt/file.bak rm
- 使用Kubespray在ubuntu上自动部署K8s1.9.0集群
Kubespray 是 Kubernetes incubator 中的项目,目标是提供 Production Ready Kubernetes 部署方案,该项目基础是通过 Ansible Playbo ...
- C# 集合类型学习
如果你掌握了一门语言的数据结构 ,那么你离掌握这门语言 也不远了 1.列表 对于list,值得一提的是 Capacity 属性,使用默认的构造函数 ,让我们用代码来说明 var intList = n ...
- Linux - 命令 - top命令
负载检查:https://blog.csdn.net/HANLIPENGHANLIPENG/article/details/79172053 参考:https://blog.csdn.net/gxia ...
- Java面向对象编程 -1.5
对象引用传递分析 类本身属于引用传递类型,既然是引用传递类型,那么就牵扯到内存的引用传递 所谓的引用传递的本质:同一块堆内存空间可以被不同的栈内存所指向,也可以更换指向. class Person{ ...
- 「CF1301C Ayoub's function」
本题结论题,所以就不放前置芝士了. 具体做法 先将最终的答案分为两部分,区间(开始于结束为止不同)和点,点的个数非常显然就是M,于是要计算区间的个数,可以发现如果直接计算有多少合法区间很麻烦,所以用总 ...
- mysqld: [ERROR] Found option without preceding group in config file D:\TONG\mysql-5.7.19-winx64\my.ini at line 1!
my.ini文件编码不对,改为ANSI 貌似大意是说,配置不全 改编码为ANSI解决
- nyoj 24
素数距离问题 时间限制:3000 ms | 内存限制:65535 KB 难度:2 描述 现在给出你一些数,要求你写出一个程序,输出这些整数相邻最近的素数,并输出其相距长度.如果左右有等距离长度 ...
- Vue专题系列
一. 简介 1. 说明 Vue (读音 /vjuː/,类似于 view) 是一套用于构建用户界面的渐进式框架.与其它大型框架不同的是,Vue 被设计为可以自底向上逐层应用.Vue 的核心库只关注视图 ...
- 解决RStudio(非conda安装)在使用Anaconda中的R环境时,缺失“ libbz2-1.dll ”而不能正常启动问题
1.问题描述 当非conda安装的RStudio,在调用Anaconda中的R环境时,报如下错误: 2.解决办法 下载同版本的R,对Anaconda中R相应的文件进行替换(图标中标注的部分) R3.5 ...