当前位置:   article > 正文

fatal: unable to access ‘https://github.com/xxx/123.git/‘: Failed connect to github.com:443 解决方案

fatal: unable to access

在linux上git clone时遇到
fatal: unable to access 'https://github.com/xx/xx.git/': Failed connect to github.com:443; Connection timed out时如图

解决方法:把https:改成git

git clone git@github.com:xx/xx.git

如果没有成功,遇上以下报错

  1. no such identity: /root/.ssh/id_rsa: No such file or directory
  2. Permission denied (publickey).
  3. fatal: Could not read from remote repository.
  4. Please make sure you have the correct access rights
  5. and the repository exists.

配置用户名,邮箱

git config --global user.email "123@126.com"

给该邮箱设置公钥

ssh-keygen -t rsa -C "123@126.com"

回车三次后 得到如图

 设置成功后进入~/.ssh,

  1. cd ~/.ssh
  2. cat id_rsa.pub

 

 复制公钥(ssh-rsa到邮箱那一块就是了)到github上的settings上添加设置的公钥

 

后面再回linux上重新克隆就没有问题了 

 

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/646440
推荐阅读
相关标签
  

闽ICP备14008679号