14: ssh: connect to host github.com port 22: Connection timed out的解决

公钥已经加到git上,可是本地依然报错:

  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:执行 ssh -T git@github.com, 依然报错。

          2: 执行  cd ~/.ssh, 建一个文件config, 文件内容如下:

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

         3: 再执行ssh -T git@github.com 就可以了

 

posted @ 2021-01-04 15:39  刘大飞  阅读(1565)  评论(0编辑  收藏  举报