git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.

2022-07-25,,,,

1.配置名称email

$ git config --global user.name = "xxx"
$ git config --global user.email = "xxx@gmail.com"

2.生成密钥

执行命令,然后输入三次空格。

$ ssh-keygen -t rsa -C "xx@email.com"


Generating public/private rsa key pair.
Enter file in which to save the key (/c/Users/xxx/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /c/Users/xxx/.ssh/id_rsa
Your public key has been saved in /c/Users/xxx/.ssh/id_rsa.pub
The key fingerprint is:
SHA256:zPv8J3degimJKIhkaCsdF8fts9VWIeZpUPYFWu33ejM chents@gmail.com
The key's randomart image is:
+---[RSA 3072]----+
|          ..= +o.|
|     . .   = * o.|
|    . o .   = o. |
|.    o +   o .  o|
|.+. .   S . o   o|
|+o.+   . * o o  .|
|o.o . . + o o ...|
|.    .   o .. +E+|
|          o..+ ++|
+----[SHA256]-----+

Your public key has been saved in /c/Users/xxx/.ssh/id_rsa.pub
打开文件,把内容复制到github的密钥处。

3.点击github账户,找到setting

本文地址:https://blog.csdn.net/chentaishan/article/details/112546066

《git@github.com: Permission denied (publickey). fatal: Could not read from remote repository..doc》

下载本文的Word格式文档,以方便收藏与打印。