今天在提交代码的时候:

ssh: connect to host github.com port 22: Connection refused
fatal: 无法读取远程仓库。 请确认您有正确的访问权限并且仓库存在。

英文:
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.

 刚开始重启IDEA,后来重启虚拟机,再后来重启电脑。百度上还有说是wifi问题,插了网线也无法解决。

后来找到了如下方法,解决问题,顺利提交代码:

ai@aiai:~$ vim .ssh/config

内容为:

Host github.com
User #################@qq.com                                       (这个地方是写github登陆时的用户名)
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/Ai                                               (私钥地址)
Port 443

之后可以使用如下命令测试

ssh -T git@github.com
返回:Hi user1! You've successfully authenticated, but GitHub does not provide shell access. 则正常
若:ssh: connect to host github.com port 22: Connection refused 则需要检查配置是否正确

Ubuntu中发生git Connection refused的更多相关文章

  1. Ubuntu 中使用git 上传代码

    现在很多人都愿意把自己的代码分享给大家,所以有很多的代码管理的软件 ,比如SVN Git 等软件.今天就讲一下  git 的简单的应用,上传代码.用 git 上传代码 要有个git 账号,这是必不少的 ...

  2. Ubuntu中搭建git

    1.配置用户名和邮箱 git config --global user.name "xiaoming" git config --global user.email "x ...

  3. Ubuntu远程连接MySQL(connection refused)解决方法

    一.判断ubuntu是否开启防火墙 sudo ufw status 开放防火墙3306端口 sudo ufw allow 3306 二.查看3306端口是否打开  注意:红色框框表示3306绑定的ip ...

  4. putty连接ubuntu:network error:connection refused

    原因: ubuntu存在一个bug:在/var/run/目录下缺少一个文件夹sshd 解决方法: 在命令行输入: sudo mkdir /var/run/sshd sudo /usr/sbin/ssh ...

  5. ubuntu中git

    1.在ubuntu中安装git $ sudo apt-get install git git-core 2.配置本机的git $ git config --global user.name " ...

  6. 解决git Failed to connect to 127.0.0.1 port xxxx: Connection refused

    某天,用git拉取,提交代码的时候出现了git Failed to connect to 127.0.0.1 port xxxx: Connection refused的问题, 开始百度,看了一通.都 ...

  7. ubuntu安装配置ssh-connect to host localhost port 22: Connection refused

    在安装ssh,经常出现 ssh: connect to host localhost port 22: Connection refused 从以下几点去检查: 1.是否安装ssh-server: 打 ...

  8. ZooKeeper集群搭建中的Connection refused而导致的启动失败

    1. 前言 每一次搭建集群环境都像一次战斗,作战中任何一个细节的出错都会导致严重的后果,所以搭建中所需要做的配置如系统配置.网络配置(防火墙记得关).用户权限.文件权限还有配置文件等等内容,都必须非常 ...

  9. []: secureCRT连接ubuntu问题- The remote system refused the connection

    secureCRT连接ubuntu问题- The remote system refused the connection http://jxyang.iteye.com/blog/1484915 解 ...

随机推荐

  1. Understanding dopamine and reinforcement learning: The dopamine reward prediction error hypothesis

    郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! Abstract 在中脑多巴胺能神经元的研究中取得了许多最新进展.要了解这些进步以及它们之间的相互关系,需要对作为解释框架并指导正在进行的 ...

  2. java进阶(10)--String(StringBuff、StringBuilder)

    一.基本概念 1.String为引用数据类型,使用双引号 2.字符串数组存储在方法区的内存池,因为开发过程种使用过于频繁 3.String类已经重写了equals,比较时使用,同时也重写了toStri ...

  3. CSP 201312-1 出现次数最多的数

    思路 由于输入的数组元素是 1 ≤ si ≤ 10000,所以开一个 10001 的数组.输入的过程中使用 num 记录出现的最大次数: 在所有输入结束后,遍历数组元素,由于题目要求出现多个众数输出最 ...

  4. git最基础常用操作

    单人开发托管够用 未列出的用到一个补一个

  5. MySQL 外部联结 内连接、左右外连接辨析

    内连接 在进行跨表内连接查询数据时,查询结果只返回符合查询条件的数据:跨表内连接查询的结果和使用where的多表查询结果相同,其实就是普通的查询,没啥好说的 -- 语法: SELECT 别名1.字段名 ...

  6. Oracle 11G R2安装说明 -九五小庞

    教程版本Oracle 11.2.0.1.0

  7. Ajxax技术-1

    1.什么是Ajax Ajax: Asynchronous javascript and xml (异步javascript和xml). ==Ajax并不是一种新技术,而是已有技术的集合.JavaScr ...

  8. 项目中使用mybatis报错:对实体 "serverTimezone" 的引用必须以 ';' 分隔符结尾。

    报错信息如下: Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException: ### ...

  9. 从通达信导出文件获取A股所有股票代号名称(至2020年2月24日)

    下文是讲述如何从通达信的输出文件中获得股票信息,如果想用Java爬虫从网页爬取信息请参考:https://www.cnblogs.com/xiandedanteng/p/12808381.html 要 ...

  10. Cassandra-Java(增删查改)

    驱动下载 创建maven工程,让maven来维护我们的jar,maven最重要的pom文件内容如下: <project xmlns="http://maven.apache.org/P ...