出现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. windows10 通过ssh访问 linux

    安装openssh服务 Win10其实自带OpenSSH 没有的话,点击上面的添加找到并安装 在服务里设置对应服务开机启动 添加服务器到已知主机 ssh-keygen -R 你的服务器ip 连接Lin ...

  2. 翻页插件 jquery

    //css <style> * { padding:; margin:; list-style: none; } .wrapper { width: 100%; cursor: point ...

  3. 显ipQQ

    链接:https://pan.baidu.com/s/1l1WN4b3jT8n4e66DH8d-cg 提取码:kjm4

  4. query_phase_execution_exception

    ES报错信息: { "error": { "root_cause": [ { "type": "query_phase_execu ...

  5. C语言-数组与指针 字符与字符串

    1 字符与字符串:char c='a'而不能写出char c="a" //字符变量用单引号'',而字符串用双引号. 2 字符数组与字符指针的初始化: char s[10]={0}, ...

  6. springMVC 的拦截器理解

    请复制以下链接看,我只是搬运工 http://blog.csdn.net/yerenyuan_pku/article/details/72567761 http://blog.csdn.net/u01 ...

  7. 对RoboMaster论坛自动签到脚本制作(虽然没什么用)

    RoboMaster论坛自动签到,自动浏览刷分 不务正业系列 上完最后一节课,队长跟我们说,RM有个BBS,可以看看,但是下载要金币,这个金币只能做签到等事情才能得到,所以我用python做了一个小程 ...

  8. jquery-ajax的用法

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  9. 类似discuz密码的生成规则

    /* 生成一个串,uniqid(rand()): uniqid(prefix,more_entropy) 函数基于以微秒计的当前时间,生成一个唯一的 ID. 如果 prefix 参数为空,则返回的字符 ...

  10. Lesson 15 Secrecy in industry

    Why is secrecy particularly important in the chemical industries? Two factors weigh heavily against ...