zoukankan      html  css  js  c++  java
  • Ubuntu中发生git Connection refused

    今天在提交代码的时候:

    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 则需要检查配置是否正确
  • 相关阅读:
    改 hadoop ssh 端口
    java.lang.OutOfMemoryError: Java heap space 解决方法
    LucidGaze for Solr 搜索监测工具
    hadoop 文件浏览器
    CF1427C Solution
    技术经理必备的六个好习惯
    今天申请博客
    同志们都走了!!
    好笑
    今天看了《浅谈多态》这篇文章
  • 原文地址:https://www.cnblogs.com/easilyai/p/12371659.html
Copyright © 2011-2022 走看看