'[email protected]: Permission denied (publickey,password)

I google online to find the solution and tried as this link https://docs.github.com/cn/authentication/troubleshooting-ssh/error-permission-denied-publickey

But it didn't work.

  1. When I type ssh -vT [email protected], the result:
OpenSSH_8.2p1 Ubuntu-4ubuntu0.4, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /home/zetlin/.ssh/config
debug1: /home/zetlin/.ssh/config line 1: Applying options for github.com
debug1: /home/zetlin/.ssh/config line 12: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to github.com [141.164.49.108] port 22.
debug1: Connection established.
debug1: identity file /home/zetlin/.ssh/id_github type 0
debug1: identity file /home/zetlin/.ssh/id_github-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.4p1 Ubuntu-6ubuntu2.1
debug1: match: OpenSSH_8.4p1 Ubuntu-6ubuntu2.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to github.com: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:UIDrRc6***************sgm7HpmED92IuKCo
debug1: Host 'github.com' is known and matches the ECDSA host key.
debug1: Found key in /home/zetlin/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/zetlin/.ssh/id_github RSA SHA256:7O+NeSr******************1A8rOv6l+amG9s explicit agent
debug1: Will attempt key: Zelin_Xu@********.com RSA SHA256:cc95TN**********************N9E61y1Z9kbGA agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /home/zetlin/.ssh/id_github RSA SHA256:7O+NeSr*****************1A8rOv6l+amG9s explicit agent
debug1: Authentications that can continue: publickey,password
debug1: Offering public key: Zelin_Xu@*********.com RSA SHA256:cc95TN*******************9E61y1Z9kbGA agent
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey,password).

enter image description here

  1. When type ssh-add -l -E sha256 the result is same as github ssh keys enter image description here

  2. I tried as here https://docs.github.com/en/authentication/troubleshooting-ssh/error-permission-denied-publickey, when type eval "$(ssh-agent -s)", then typessh-add -l -E sha256 , output is The agent has no identities. when type ssh -T [email protected], the terminator ask me to input the [email protected]'s password: , either the password to login in the github website or the password to ssh-gen(actually no password) is not OK. Which password should I type here?

Agent pid 16629
➜  apollo git:(predtr) ssh-add -l -E sha256  
The agent has no identities.
➜  apollo git:(predtr) ssh-agent bash      
(base) zetlin@zetlin-HP-Z4-G4-Workstation:~/Code/github/apollo$ ssh-add ~/.ssh/id_github
Identity added: /home/zetlin/.ssh/id_github ([email protected])
(base) zetlin@zetlin-HP-Z4-G4-Workstation:~/Code/github/apollo$ ssh -T [email protected]
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
Permission denied, please try again.
[email protected]'s password: 
[email protected]: Permission denied (publickey,password).

Update:

  1. Follow the tips, maybe the configuration is conflicting, I delete the configure files& keys files in /etc/ssh/ssh_config & known_hosts in /home/zetlin/known_hosts, then command ssh -vT [email protected], the result:
➜  ~ ssh -vT [email protected]
OpenSSH_8.2p1 Ubuntu-4ubuntu0.4, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /home/zetlin/.ssh/config
debug1: /home/zetlin/.ssh/config line 1: Applying options for github.com
debug1: /home/zetlin/.ssh/config line 11: Applying options for *
debug1: Connecting to github.com [141.164.49.108] port 22.
debug1: Connection established.
debug1: identity file /home/zetlin/.ssh/id_github type 0
debug1: identity file /home/zetlin/.ssh/id_github-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.4
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.4p1 Ubuntu-6ubuntu2.1
debug1: match: OpenSSH_8.4p1 Ubuntu-6ubuntu2.1 pat OpenSSH* compat 0x04000000
debug1: Authenticating to github.com: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:UIDr***************************92IuKCo
debug1: Host 'github.com' is known and matches the ECDSA host key.
debug1: Found key in /home/zetlin/.ssh/known_hosts:1
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /home/zetlin/.ssh/id_github RSA SHA256:7O+NeSr****************1A8rOv6l+amG9s explicit agent
debug1: Will attempt key: Zelin_Xu@******************.com RSA SHA256:cc95TN*****************61y1Z9kbGA agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected],[email protected]>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering public key: /home/zetlin/.ssh/id_github RSA SHA256:7O+NeSr**************Ov6l+amG9s explicit agent
debug1: Authentications that can continue: publickey,password
debug1: Offering public key: Zelin_Xu@********.com RSA SHA256:cc95TNApI**********************1y1Z9kbGA agent
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: password
[email protected]'s password: 
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
[email protected]'s password: 
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
[email protected]'s password: 
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
[email protected]: Permission denied (publickey,password).

I still don't know the password

update:

  1. I could git clone 'https' but not 'ssh'


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source