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 则需要检查配置是否正确
  • 相关阅读:
    MySQL--字符集参数
    MySQL--字符集基础
    Cassandra基础2
    Cassandra基础
    Cassandra -- Cassandra 3.0版本安装
    Cassandra Demo--Python操作cassandra
    MySQL--批量插入导致自增跳号问题
    MySQL Disk--SSD和HDD的性能
    MySQL Lock--并发插入导致的死锁
    TCL-视图
  • 原文地址:https://www.cnblogs.com/easilyai/p/12371659.html
Copyright © 2011-2022 走看看