Tag Archives: Permission denied (publickey

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 'github.com (13.229.188.59)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no)?yes
Warning: Permanently added 'github.com,13.229.188.59' (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_ rsa.pub

Test, success

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

My command is as follows

[root@VM_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/id_rsa.pub.
The key fingerprint is:
c8:b9:17:bf:e7:9b:8b:ba:9f:e1:23:0d:1c:6a:64:45 root@VM_171_105_centos
The key's randomart image is:
+--[ RSA 2048]----+
|       .E        |
|        .        |
|       .         |
|     .oo.        |
|     o+oS.       |
|      o.oo       |
|     .. .oo      |
|       ...o=..   |
|        o=*+=o   |
+-----------------+
[root@VM_171_105_centos src]# ssh -T [email protected]
Permission denied (publickey).
[root@VM_171_105_centos src]# cd /root/.ssh/
[root@VM_171_105_centos .ssh]# ls
authorized_keys  id_rsa  id_rsa.pub  known_hosts
[root@VM_171_105_centos .ssh]# cat id_rsa.pub 
ssh-rsa AAAAB3AAABIwAAAQEAzVPno/Cm5ApGGMP8YjituJGegOCq7TVKVECehWog9hTfC0Z5PMsf5OWkWvUZ85nFJBuwhMszxkjFSd7e6INYJ42WfGKxPXm7ZoOQxkBZAetUUaNvDhCKZCdLNHWGde8gaX84i39JKWgwYrzX9Y1T+bDI1cJiUuNN6Xr8x4ZkMm4e+LugYtVSKGZKz7zLcp1mXQszh9mWM08/yyRq/CdTEly1ghojUDUNFTzyk6VQz/rzMFoiVuwbYlQasqdR4xIzvnIjfBrtSP4z+qdD+wZFvSABnFClXH0nJEaaKX9EdJpi2ezvLvAblDg371J
[root@VM_171_105_centos .ssh]# ssh -T [email protected]
Hi kylePan! You've successfully authenticated, but GitHub does not provide shell access.

Git Connect Error: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).

I want to pull remote project to local

E:\files\github\gmdropship>git pull git@ip:username/ship_web.git
git@ip's password:
Permission denied, please try again.
git@ip's password:
Permission denied, please try again.
git@ip's password:
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
fatal: Could not read from remote repository.

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

Found repeatedly asked to enter the password, the password is right, but still show no authority. To view the SSH connection log:

E:\files\github\gmdropship>ssh -vT git@ip
OpenSSH_for_Windows_7.6p1, LibreSSL 2.6.4
debug1: Reading configuration data C:\\Users\\Micky/.ssh/config
debug1: Connecting to ip [ip] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\Micky/.ssh/id_rsa type 0
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file C:\\Users\\Micky/.ssh/id_ed25519-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.4
debug1: match: OpenSSH_7.4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to ip:22 as 'git'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:VUmEOh8FW/w2DaxFRH9SCrvIIF5j0dcEpxUy3Z7BtV4
debug1: Host 'ip' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\Micky/.ssh/known_hosts:4
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: publickey
debug1: Offering public key: RSA SHA256:B8BjflVLnBcR/eD2USLssP40zIZSbdj0o2Dl9aGFuOo C:\\Users\\Micky/.ssh/id_rsa
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password
debug1: Trying private key: C:\\Users\\Micky/.ssh/id_dsa
debug1: Trying private key: C:\\Users\\Micky/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\Micky/.ssh/id_ed25519
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such file or directory
git@ip's password:
Connection closed by ip port 22

[solution] find out our public key address through the log C:: <users/Micky \. SSH , and put the public key content on the SSH – keys setting on git platform