I'm failing to access GitHub.com via SSH (for pushing with GitHub desktop). My client is a Windows 10 system.
It used to work until yesterday. I had some problems and then I decided to reinitialize the SSH environment. I deleted the public key on server (GitHub.com) side and then added again. Since then I'm in trouble. When pushing I see this:
I've created an ed25519 public/private keypair and added the public key to the server. All seems fine. When issuing "ssh -T git@github.com" the response is:
PS C:\WINDOWS\system32> ssh git@github.com
PTY allocation request failed on channel 0
Hi <user>! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
When issuing "sss -T @github.com" the response is:
PS C:\WINDOWS\system32> ssh <user>@github.com
<user>@github.com: Permission denied (publickey).
The complete trace is:
PS C:\WINDOWS\system32> ssh -vT <user>@github.com
OpenSSH_for_Windows_8.1p1, LibreSSL 3.0.2
debug1: Connecting to github.com [140.82.121.4] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\User/.ssh/id_rsa type -1
debug1: identity file C:\\Users\\User/.ssh/id_rsa-cert type -1
debug1: identity file C:\\Users\\User/.ssh/id_dsa type -1
debug1: identity file C:\\Users\\User/.ssh/id_dsa-cert type -1
debug1: identity file C:\\Users\\User/.ssh/id_ecdsa type -1
debug1: identity file C:\\Users\\User/.ssh/id_ecdsa-cert type -1
debug1: identity file C:\\Users\\User/.ssh/id_ed25519 type -1
debug1: identity file C:\\Users\\User/.ssh/id_ed25519-cert type -1
debug1: identity file C:\\Users\\User/.ssh/id_xmss type -1
debug1: identity file C:\\Users\\User/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_8.1
debug1: Remote protocol version 2.0, remote software version babeld-8eb00d7e
debug1: no match: babeld-8eb00d7e
debug1: Authenticating to github.com:22 as '<user>'
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: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM
debug1: Host 'github.com' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\User/.ssh/known_hosts:7
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: <email> ED25519 SHA256:n1SJK1uvYimJC8EhOeJXmLUskx4CWQd2HQ/kjT0BKzg agent
debug1: Will attempt key: C:\\Users\\User/.ssh/id_rsa
debug1: Will attempt key: C:\\Users\\User/.ssh/id_dsa
debug1: Will attempt key: C:\\Users\\User/.ssh/id_ecdsa
debug1: Will attempt key: C:\\Users\\User/.ssh/id_ed25519
debug1: Will attempt key: C:\\Users\\User/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,ssh-dss-cert-v01@openssh.com,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,ecdsa-sha2-nistp521,ecdsa-sha2-nistp384,ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering public key: <email> ED25519 SHA256:n1SJK1uvYimJC8EhOeJXmLUskx4CWQd2HQ/kjT0BKzg agent
debug1: Authentications that can continue: publickey
debug1: Trying private key: C:\\Users\\User/.ssh/id_rsa
debug1: Trying private key: C:\\Users\\User/.ssh/id_dsa
debug1: Trying private key: C:\\Users\\User/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\User/.ssh/id_ed25519
debug1: Trying private key: C:\\Users\\User/.ssh/id_xmss
debug1: No more authentication methods to try.
<user>@github.com: Permission denied (publickey).
Any ideas about that?
Any ssh not using git
will fail: git
is the only service account allowed to query GitHub on SSH port, with the private/public key associated with that query being enough to authentication you.
The "Testing your SSH connection" page does use ssh -T git@github.com
.
Go to your repository, and test git -c "core.sshCommand='ssh -Tv'" ls-remote
You will see exactly what user and key are considered during the ls-remote
command (which needs the same credentials as for pull/push/clone).