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

即可解决!

你可能感兴趣的:(工具的错误记录,ssh,timed,out,github)