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文件, ...
随机推荐
- unittest---unittest错误截图
在做自动化的过程中,大多数执行者都不在旁边,那么如果用例失败了我们通常看报告上的失败信息,但是这样有时候可能不够清楚的判断到底哪里出了错误,我们还可以通过自动截图的功能,判断用例走到哪里出了错误. 截 ...
- windows10 通过ssh访问 linux
安装openssh服务 Win10其实自带OpenSSH 没有的话,点击上面的添加找到并安装 在服务里设置对应服务开机启动 添加服务器到已知主机 ssh-keygen -R 你的服务器ip 连接Lin ...
- Vue 项目中使用less
首先 你得有 完整的 Vue开发环境第一步 安装less 依赖 npm install less less-loader --save 第二步 修改webpack.config.js文件,配置load ...
- intellij idea设置(字体大小、背景)
1. 配置信息说明 Intellij Idea: 2017.2.5 2.具体设置 <1> 设置主题背景.字体大小 File---->Settings----->Appearan ...
- 【转】使用普通用户执行docker
原文:https://www.cnblogs.com/klvchen/p/9098745.html CentOS 版本 7.4,Docker 版本 docker-1.13 及以下 ll /var/ru ...
- jquery 分页 Ajax异步
//使用Ajax异步查询数据 <div class="table-responsive"> <table class="table table-bord ...
- 【PAT甲级】1042 Shuffling Machine (20 分)
题意: 输入洗牌次数K(<=20),输入54张牌每次洗入的位置(不是交换的位置),输出洗好的牌. AAAAAccepted code: #define HAVE_STRUCT_TIMESPEC ...
- stm32 串口发送字符串丢失第一个字节
使用stm32f103调试串口通讯时,上电后发送的字符串的第一个字节丢失. 发送数据GpuSend("SPG(2);"); 接收端收到的数据为:PG(2);,第一个字符丢失. 出现 ...
- Docker将自己的镜像发布到个人私有仓库
Docker将自己的镜像发布到个人私有仓库 1.注册dockerhub账户 docker提供了一个类似于github的仓库dockerhub, 网址https://hub.docker.com/需要注 ...
- FreeSWITCH 加载模块过程解读
今天来学习FreeSWITCH 加载模块过程. 哪些模块需要编译,是由源码下的 modules.conf 文件决定的. 哪些模块在程序启动时自动加载,是由 freeswitch/conf/autolo ...