解决: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 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

解决:Permission denied (publickey).fatal: Could not read from remote repository._第1张图片

 

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

解决:Permission denied (publickey).fatal: Could not read from remote repository._第2张图片

 

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

你可能感兴趣的:(python,ssh,服务器,运维)