最近更新项目,发现push的时候出现:
Ssh: connect to host github.com port 22: Connection timed out
Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

然后输入ssh -T [email protected]出现:

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

解决方案:

  1. 重新生成ssh:

ssh-****** -t rsa -C “你的邮箱”

  1. 默认生成的key在:C:\Users\yourUserName.ssh中有3个文件:
    $ ssh -T [email protected] ssh: connect to host ssh.github.com port 22: Connection timed out
  2. github上配置key
    $ ssh -T [email protected] ssh: connect to host ssh.github.com port 22: Connection timed out
  3. $ ssh -T [email protected]验证连接:报错

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

  1. 在ssh文件夹下添加config文件,内容如下:

Host github.com
User git
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443

  1. $ ssh -T [email protected]

$ ssh -T [email protected] ssh: connect to host ssh.github.com port 22: Connection timed out

相关文章: