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

GitHub推送 代码时报错:

ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

解决方案:

  1. 进入 C:\Users\{你的用户名}\.ssh 目录
  2. 新建config文件,不要有后缀名
  3. 增加以下内容
Host github.com
User {
   你的邮箱}
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

例如:

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

即可解决!

相关推荐

  1. 周报 | 24.4.22-24.4.28文章汇总

    2024-01-25 07:50:02       36 阅读
  2. ubuntu22 安装docker26

    2024-01-25 07:50:02       36 阅读
  3. Day22

    2024-01-25 07:50:02       51 阅读
  4. test22

    2024-01-25 07:50:02       36 阅读
  5. Python作业答疑_6.22~6.25

    2024-01-25 07:50:02       51 阅读
  6. ubuntu 18/20/22 安装 mysql 数据库

    2024-01-25 07:50:02       60 阅读
  7. Ubuntu 22.04 安装cmake3.28

    2024-01-25 07:50:02       67 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-01-25 07:50:02       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-01-25 07:50:02       100 阅读
  3. 在Django里面运行非项目文件

    2024-01-25 07:50:02       82 阅读
  4. Python语言-面向对象

    2024-01-25 07:50:02       91 阅读

热门阅读

  1. hadoop 三种运行方式

    2024-01-25 07:50:02       54 阅读
  2. centos下安装mongo C & C++ 驱动

    2024-01-25 07:50:02       56 阅读
  3. MATLAB Fundamentals>>>Fill Missing Values

    2024-01-25 07:50:02       59 阅读
  4. 常用的gpt-4 prompt words收集6

    2024-01-25 07:50:02       42 阅读
  5. 嵌入式Linux:如何进行嵌入式Linux开发?

    2024-01-25 07:50:02       54 阅读
  6. ORACLE数据导出工具

    2024-01-25 07:50:02       46 阅读
  7. TestNG @AfterClass 注解

    2024-01-25 07:50:02       50 阅读
  8. wy的leetcode刷题记录_Day76

    2024-01-25 07:50:02       58 阅读
  9. Leetcode刷题(二十九)

    2024-01-25 07:50:02       59 阅读
  10. toggle封装

    2024-01-25 07:50:02       63 阅读