欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

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

程序员文章站 2022-11-01 15:52:11
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...

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

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

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