当执行git命令如:git clone、git pull等等
出现报错:ssh: connect to host github.com port 22: Connection timed outfatal: Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.
问题主要出在是ssh密钥上,需要重置密钥,而且在git上添加
打开cmd
输入命令
ssh-keygen -t rsa -C "您的email"
一路回车,遇到(y/n)选择 y
在用户的.ssh下生成了两个SSH Key的秘钥对,id_rsa是私钥,不能泄露出去,id_rsa.pub是公钥,可以放心地告诉任何人。一般在c盘下查看
去git上设置密钥
1.
扫描二维码关注公众号,回复:
14901488 查看本文章
2.打开本地的id_rsa.pub(公钥),将内容复制进去即可
github端配置完毕即可推送代码。