最近更新项目,发现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

相关文章:

  • 2021-10-17
  • 2021-10-20
  • 2021-12-08
  • 2021-08-10
  • 2022-01-09
  • 2021-07-18
  • 2021-10-29
  • 2022-01-12
猜你喜欢
  • 2021-08-06
  • 2021-10-19
  • 2022-03-09
  • 2021-08-19
  • 2021-06-17
  • 2021-04-03
  • 2021-04-03
相关资源
相似解决方案