2025年解决:Permission denied (publickey).fatal- Could not read from remote repository.

解决:Permission denied (publickey).fatal- Could not read from remote repository.github Permission denied publickey fatal Could not read from remote repository Please make sure you have the correct access rights and the repository exists 这个问题的出现主要是 个人 SSH

大家好,我是讯享网,很高兴认识大家。

github

Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

讯享网

这个问题的出现主要是 个人SSH key被我从新覆盖了一遍 可是github上面没有添加这个SSH keydom

因此我搜索了网上的解决方法,以下:ssh

在终端输入: ssh-keygen -t rsa -C "AndIMissU"
这条命令的“”里面填写的是本身GitHub的用户名ide

终端出现:

讯享网Generating public/private rsa key pair. Enter file in which to save the key (/User///.ssh/id_rsa):

按下回车 

终端出现:

/User//.ssh/id_rsa already exists. Overwrite (y/n)? y

输入y 再 回车

终端出现:

讯享网Enter passphrase (empty for no passphrase):

按下回车


讯享网

终端显示:

Enter same passphrase again:

最后回车出现:

讯享网Your identification has been saved in /User//.ssh/id_rsa. Your public key has been saved in /User//.ssh/id_rsa.pub. The key fingerprint is: SHA256:7emPWueS2x2NHFIliv2E65vDsO9KLZo5JHwytj8aRQs AndIMissU The key's randomart image is: +---[RSA 2048]----+ | . .| | o o o | | E . . + o | | o o = | | . S . o o | | *.o..+ o + | | ..B *=+ + .| | ..oB+*o+ . | | .o*+=BO.. | +----[SHA256]-----+

咱们能够看到 咱们的SSH key就存放在 /User//.ssh/id_rsa.pub目录下
而后咱们须要查看一下 SSH key
在终端中输入 cat /User//.ssh/id_rsa.pub(这里的cat 后面加的是你本身存放的SSH key 的路径)此时cat 输入之后 出现 你要的SSH key了

 

而后:打开GitHub的Settings 添加一个新的SSH key

 

最后一步:复制刚刚cat到的SSH key 添加进入下面的红色框框内 这样咱们就能够正常的push和pull啦

小讯
上一篇 2025-02-06 08:37
下一篇 2025-02-05 21:15

相关推荐

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/82188.html