假设git例如,下面的问题时,远程推送:

[fulinux@ubuntu learngit]$ git push -u origin master
ssh: connect to host github.com port 22: Connection refused
fatal: Could not read from remote repository. Please make sure you have the correct access rights
and the repository exists.

能够採用例如以下方法:

[fulinux@ubuntu ~]$ vim .ssh/config

Host github.com
User fulinux@sina.com
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

測试连接是否成功:

[fulinux@ubuntu ~]$ ssh -T git@github.com
Hi fulinux! You've successfully authenticated, but GitHub does not provide shell access.

推送:

[fulinux@ubuntu learngit]$ git push -u origin master
The authenticity of host '[ssh.github.com]:443 ([192.30.252.151]:443)' can't be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[ssh.github.com]:443,[192.30.252.151]:443' (RSA) to the list of known hosts.
Counting objects: 23, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (18/18), done.
Writing objects: 100% (23/23), 1.87 KiB | 0 bytes/s, done.
Total 23 (delta 6), reused 0 (delta 0)
To git@github.com:fulinux/learngit.git
* [new branch] master -> master
Branch master set up to track remote branch master from origin.


版权声明:本文博主原创文章,博客,未经同意不得转载。

ssh: connect to host github.com port 22: Connection refused的更多相关文章

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

  2. Github拉取远端的时候提示“ssh: connect to host github.com port 22: Connection timed out”错误

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

  3. 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: ...

  4. 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不能连接上,但是 ...

  5. 关于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 ...

  6. 关于github报错 ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository.

    今天上午写demo的时候,突然pull不下代码了,报了一下这样情况的错误: 看了一下代码,怀疑是网路错误,因为在这以前一切都正常的,然后将代码复制搜索了一番,解决办法有很多什么配置config啦,gi ...

  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: Bad file number git did not exit cleanly (exit code 128)

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

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

    方案1(本人使用此方案,问题得已解决): 可能是ssh-server未安装或者未启动.我的ubuntu 12.04 默认只安装了openssh-client,并没有安装server. 运行 ps -e ...

随机推荐

  1. OpenCL 查看设备信息

    好久没搞OpenCL了.可是这是个好东西.不能不学,之前发了篇设置OpenCL的文章.看的人还真多,看来大家都知道这个好东西了,都想把OpenCL搞起.只是学习难度还是相当高的. 之前忙搞算法,所以非 ...

  2. Java集合关于ArrayList

    ArrayList实现源码分析 2016-04-11 17:52 by 淮左, 207 阅读, 0 评论, 收藏, 编辑 本文将以以下几个问题来探讨ArrayList的源码实现1.ArrayList的 ...

  3. Maven + Jetty + Jersey搭建RESTful服务

    IntelliJ IDEA + Maven + Jetty + Jersey搭建RESTful服务 本文参考以下内容: 使用Jersey实现RESTful风格的webservice(一) Starti ...

  4. SWT的TableVierer的使用三(数据筛选和着色)

    如果我们想根据某一列来过滤记录,如何实现呢?很简单,定义一个过滤器filter.这里只演示定义一个过滤器的情况.现实中你可以定义多个灵活的过滤器,通过替换过滤器来实现各种各样的过滤.一.过滤器代码: ...

  5. Linux智能小开关rfkill

    Linux智能小开关rfkill Rfkill,当中rf是Radio frequency(射频).主要作用是一个专门管理开关的子系统,举例说明Android手机的通知栏能够方便地开关Airplane/ ...

  6. bootstrap之DumpWindowHierarchy

    DumpWindowHierarchy package io.appium.android.bootstrap.handler; import android.os.Environment; impo ...

  7. Ice-2.1.2在RHEL Server 5.5上的安装

         因为项目的需要,服务器上的程序需要使用Ice接口与其它程序通信,对方提供了一个Windows版的工程,我要把它移植到Linux服务器上,既然Ice是跨平台跨语言的中间件,想来移植不是很困难, ...

  8. Python学习入门基础教程(learning Python)--3.3.1 Python下的布尔表达式

    简单的说就是if要判断condition是真是假,Python和C语言一样非0即真,所以如果if的condition是布尔表达式我们可以用True或者非0数(不可是浮点数)表示真,用False或者0表 ...

  9. MySQL先进的技术-存储引擎

    MySQL功能被分成两部分,主要有成品的外部client连接和可行性研究SQL函数语句,内侧部分被称为存储引擎,它负责接收外部操作指令数据,实际数据是完整的,文件输入和输出操作的工作 版权声明:本文博 ...

  10. 疯狂Java学习笔记(84)----------大约 Java 对象序列化,你不知道 5 事

    几年前,.当一个软件团队一起用 Java 书面申请.我认识比一般程序猿多知道一点关于 Java 对象序列化的知识所带来的优点. 关于本系列 您认为自己懂 Java 编程?其实,大多数程序猿对于 Jav ...