GitHub prompts permission denied (public key). How can I solve this problem?

Why are there a series of technical challenges behind “OMG buy it”>>>

$ git clone [email protected]:gogo/protobuf.git
Cloning into 'protobuf'...
The authenticity of host ' (' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?yes
Warning: Permanently added ',' (RSA) to the list of known hosts.
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

The settings SSH and GPG keys new SSH key in GitHub are shown in the figure below

Go back to the machine terminal where you need to download the source code

Type in the command and return all the way

#ssh-keygen -t rsa

Then go to the/root /. SSH/directory

Take out the public key, copy and paste it into the key in GitHub, and then save it

#cat id_

Test, success

#ssh -T [email protected]
Hi kylePan! You’ve successfully authenticated, but GitHub does not provide shell access.

My command is as follows

[[email protected]_171_105_centos src]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/
The key fingerprint is:
c8:b9:17:bf:e7:9b:8b:ba:9f:e1:23:0d:1c:6a:64:45 [email protected]_171_105_centos
The key's randomart image is:
+--[ RSA 2048]----+
|       .E        |
|        .        |
|       .         |
|     .oo.        |
|     o+oS.       |
|      o.oo       |
|     .. .oo      |
|       ...o=..   |
|        o=*+=o   |
[[email protected]_171_105_centos src]# ssh -T [email protected]
Permission denied (publickey).
[[email protected]_171_105_centos src]# cd /root/.ssh/
[[email protected]_171_105_centos .ssh]# ls
authorized_keys  id_rsa  known_hosts
[[email protected]_171_105_centos .ssh]# cat 
ssh-rsa AAAAB3AAABIwAAAQEAzVPno/Cm5ApGGMP8YjituJGegOCq7TVKVECehWog9hTfC0Z5PMsf5OWkWvUZ85nFJBuwhMszxkjFSd7e6INYJ42WfGKxPXm7ZoOQxkBZAetUUaNvDhCKZCdLNHWGde8gaX84i39JKWgwYrzX9Y1T+bDI1cJiUuNN6Xr8x4ZkMm4e+LugYtVSKGZKz7zLcp1mXQszh9mWM08/yyRq/CdTEly1ghojUDUNFTzyk6VQz/rzMFoiVuwbYlQasqdR4xIzvnIjfBrtSP4z+qdD+wZFvSABnFClXH0nJEaaKX9EdJpi2ezvLvAblDg371J
[[email protected]_171_105_centos .ssh]# ssh -T [email protected]
Hi kylePan! You've successfully authenticated, but GitHub does not provide shell access.

Similar Posts: