1. 异常


在连接github时,执行”ssh -T git@github.com” 命令时,出现

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

2. 解决方法


在存放公钥私钥(id_rsa和id_rsa.pub)的文件里,新建config文本,内容如下:

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

其中User为登录github的账号名称。
再次执行”ssh -T git@github.com”时,会出现提示如下,回车”yes”即可。
github连接报"ssh: connect to host github.com port 22: Connection timed out"错误
这时验证就可以通过。
github连接报"ssh: connect to host github.com port 22: Connection timed out"错误

相关文章:

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