今天在提交代码的时候:

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. Vue中keep-alive组件的理解

    对keep-alive组件的理解 当在组件之间切换的时候,有时会想保持这些组件的状态,以避免反复重渲染导致的性能等问题,使用<keep-alive>包裹动态组件时,会缓存不活动的组件实例, ...

  2. Privacy-Preserving Deep Learning via Additively Homomorphic Encryption

    郑重声明:原文参见标题,如有侵权,请联系作者,将会撤销发布! Full version of a paper at the 8-th International Conference on Appli ...

  3. 洛谷 P4284 [SHOI2014]概率充电器 概率与期望+换根DP

    洛谷 P4284 [SHOI2014]概率充电器 概率与期望+换根DP 题目描述 著名的电子产品品牌\(SHOI\) 刚刚发布了引领世界潮流的下一代电子产品-- 概率充电器: "采用全新纳米 ...

  4. 2020重新出发,MySql基础,MySql视图&索引&存储过程&触发器

    @ 目录 视图是什么 视图的优点 1) 定制用户数据,聚焦特定的数据 2) 简化数据操作 3) 提高数据的安全性 4) 共享所需数据 5) 更改数据格式 6) 重用 SQL 语句 MySQL创建视图 ...

  5. 一个简单的Android音乐播放器

    Android小白的期末作业 Android期末项目,仅用作学习使用,在线音乐部分只获取了网易云热歌榜,API来自鼻子亲了脸 传送门: GitHub 参考: anddiencn 实现功能 展示出本地的 ...

  6. gdb我在我本机上p不了,在别人机子上可以

    gdb我在我本机上p不了,在别人机子上可以,不知道什么 (gdb) p EventFlow->devicetypeThere is no member or method named devic ...

  7. JS数组遍历的十二种方式

    遍历有如下几种方式 数组方法 map forEach filter find findIndex every some reduce reduceRight 其他方法 for for in for o ...

  8. Kubernetes实战总结 - 阿里云ECS自建K8S集群

    一.概述 详情参考阿里云说明:https://help.aliyun.com/document_detail/98886.html?spm=a2c4g.11186623.6.1078.323b1c9b ...

  9. mac 下配置连接Linux服务器方法,上传下载文件操作

    1.先按照文档在本地生成SSHkey 2.mac输入 sudo -i 进入超级管理员#模式下,然后 创建用户 #useradd XXXadmin #passwd XXXadmin XXXadmin用户 ...

  10. 12 props 传的是数组处理

    <template> <div>InfoDetailed</div> </template> <script> export default ...