ssh: connect to host github.com port 22: Connection refusedfatal: Could not read from remote reposi

当执行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.

 2.打开本地的id_rsa.pub(公钥),将内容复制进去即可

github端配置完毕即可推送代码。

猜你喜欢

转载自blog.csdn.net/slow097/article/details/125558111
今日推荐