title: github ssh key not accepted, getting ssh packet type 51 (
body: <p>I am trying to set up an ssh key on my github account, but it is continually rejected by the github server. My client is an Ubuntu based system.</p>
  <p>On Ubuntu, I created a public and private key, stored in ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub. Permissions for ~/.ssh are 700, for id_rsa are 600, and for id_rsa.pub are 644.</p>
  <p>When I created the key (on Ubuntu, with ssh-keygen) the sha256 fingerprint computed and displayed by ssh-keygen matches <em>exactly</em> the fingerprint displayed in my github account (settings &gt; account settings &gt; SSH and GPG keys) for that key after I've pasted it into github and clicked on [Save]. Therefore, I am certain the public key I stored in github was correctly pasted and stored in my github account.</p>
  <p>Nevertheless, when I attempt to ssh to github I get permission denied. So I increased the logging level from the client ssh application and have pasted the output below.</p>
  <p>The command I issued was...</p>
  <pre><code>ssh -vvv -T zzzzz60@github.com
  </code></pre>
  <p>Looking through the debug output, I see two clues ...</p>
  <pre><code>debug1: Remote protocol version 2.0, remote software version babeld-0843ac0d
  debug1: no match: babeld-0843ac0d
  </code></pre>
  <p>... which seems to be telling me that the ssh daemon on github is not one that my Ubuntu ssh client knows about. I am not sure how much of an issue this is. My guess is that it is merely a warning. FWIW, it does report ssh protocol 2.0 - which is the same protocol version being used by my Ubuntu client.</p>
  <p>A much more significant log entry is this...</p>
  <pre><code>debug2: service_accept: ssh-userauth
  debug1: SSH2_MSG_SERVICE_ACCEPT received
  debug3: send packet: type 50
  debug3: receive packet: type 51
  </code></pre>
  <p>... packet type '51' is defined as <code>SSH_MSG_USERAUTH_FAILURE</code> (per <a href="https://www.iana.org/assignments/ssh-parameters/ssh-parameters.xhtml" rel="nofollow noreferrer">IANA SSH List</a>).</p>
  <p>That is certainly significant! However, it only tells us that github did not like our key for some reason. It does NOT explain <em>why</em> it did not like our key.</p>
  <p>I've been unable to progress any further. I keep hitting a brick was at this point. I cannot understand <em>why</em> github is rejecting this key. It's fingerprint matches exactly the value displayed by ssh-keygen.</p>
  <p>So that's where I'm at. I've seen similar questions here ... but no solutions. My hope is that by supplying the debug output someone might have a clue.</p>
  <p>Here is the complete debug output...</p>
  <pre><code>% ssh -vvvT zzzzz60@github.com
  OpenSSH_8.2p1 Ubuntu-4ubuntu0.2, OpenSSL 1.1.1f  31 Mar 2020
  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 *
  debug2: resolving &quot;github.com&quot; port 22
  debug2: ssh_connect_direct
  debug1: Connecting to github.com [140.82.113.3] port 22.
  debug1: Connection established.
  debug1: identity file /home/zzzzz60/.ssh/id_rsa type 0
  debug1: identity file /home/zzzzz60/.ssh/id_rsa-cert type -1
  debug1: identity file /home/zzzzz60/.ssh/id_dsa type -1
  debug1: identity file /home/zzzzz60/.ssh/id_dsa-cert type -1
  debug1: identity file /home/zzzzz60/.ssh/id_ecdsa type -1
  debug1: identity file /home/zzzzz60/.ssh/id_ecdsa-cert type -1
  debug1: identity file /home/zzzzz60/.ssh/id_ecdsa_sk type -1
  debug1: identity file /home/zzzzz60/.ssh/id_ecdsa_sk-cert type -1
  debug1: identity file /home/zzzzz60/.ssh/id_ed25519 type -1
  debug1: identity file /home/zzzzz60/.ssh/id_ed25519-cert type -1
  debug1: identity file /home/zzzzz60/.ssh/id_ed25519_sk type -1
  debug1: identity file /home/zzzzz60/.ssh/id_ed25519_sk-cert type -1
  debug1: identity file /home/zzzzz60/.ssh/id_xmss type -1
  debug1: identity file /home/zzzzz60/.ssh/id_xmss-cert type -1
  debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.2
  debug1: Remote protocol version 2.0, remote software version babeld-0843ac0d
  debug1: no match: babeld-0843ac0d
  debug2: fd 3 setting O_NONBLOCK
  debug1: Authenticating to github.com:22 as 'zzzzz60'
  debug3: hostkeys_foreach: reading file &quot;/home/zzzzz60/.ssh/known_hosts&quot;
  debug3: record_hostkey: found key type RSA in file /home/zzzzz60/.ssh/known_hosts:4
  debug3: load_hostkeys: loaded 1 keys from github.com
  debug3: order_hostkeyalgs: prefer hostkeyalgs: rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa
  debug3: send packet: type 20
  debug1: SSH2_MSG_KEXINIT sent
  debug3: receive packet: type 20
  debug1: SSH2_MSG_KEXINIT received
  debug2: local client KEXINIT proposal
  debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c
  debug2: host key algorithms: rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-rsa-cert-v01@openssh.com,rsa-sha2-512,rsa-sha2-256,ssh-rsa,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,ssh-ed25519-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,ssh-ed25519,sk-ssh-ed25519@openssh.com
  debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
  debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com
  debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
  debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1
  debug2: compression ctos: none,zlib@openssh.com,zlib
  debug2: compression stoc: none,zlib@openssh.com,zlib
  debug2: languages ctos: 
  debug2: languages stoc: 
  debug2: first_kex_follows 0 
  debug2: reserved 0 
  debug2: peer server KEXINIT proposal
  debug2: KEX algorithms: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256
  debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ssh-rsa,ssh-dss
  debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc
  debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes256-gcm@openssh.com,aes128-gcm@openssh.com,aes256-ctr,aes192-ctr,aes128-ctr,aes256-cbc,aes192-cbc,aes128-cbc
  debug2: MACs ctos: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-sha1-etm@openssh.com,hmac-sha1
  debug2: MACs stoc: hmac-sha2-512-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512,hmac-sha2-256,hmac-sha1-etm@openssh.com,hmac-sha1
  debug2: compression ctos: none
  debug2: compression stoc: none
  debug2: languages ctos: 
  debug2: languages stoc: 
  debug2: first_kex_follows 0 
  debug2: reserved 0 
  debug1: kex: algorithm: curve25519-sha256
  debug1: kex: host key algorithm: rsa-sha2-512
  debug1: kex: server-&gt;client cipher: chacha20-poly1305@openssh.com MAC: &lt;implicit&gt; compression: none
  debug1: kex: client-&gt;server cipher: chacha20-poly1305@openssh.com MAC: &lt;implicit&gt; compression: none
  debug3: send packet: type 30
  debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
  debug3: receive packet: type 31
  debug1: Server host key: ssh-rsa SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8
  debug3: hostkeys_foreach: reading file &quot;/home/zzzzz60/.ssh/known_hosts&quot;
  debug3: record_hostkey: found key type RSA in file /home/zzzzz60/.ssh/known_hosts:4
  debug3: load_hostkeys: loaded 1 keys from github.com
  debug3: hostkeys_foreach: reading file &quot;/home/zzzzz60/.ssh/known_hosts&quot;
  debug1: Host 'github.com' is known and matches the RSA host key.
  debug1: Found key in /home/zzzzz60/.ssh/known_hosts:4
  Warning: Permanently added the RSA host key for IP address '140.82.113.3' to the list of known hosts.
  debug3: send packet: type 21
  debug2: set_newkeys: mode 1
  debug1: rekey out after 134217728 blocks
  debug1: SSH2_MSG_NEWKEYS sent
  debug1: expecting SSH2_MSG_NEWKEYS
  debug3: receive packet: type 21
  debug1: SSH2_MSG_NEWKEYS received
  debug2: set_newkeys: mode 0
  debug1: rekey in after 134217728 blocks
  debug1: Will attempt key: /home/zzzzz60/.ssh/id_rsa RSA SHA256:zj5+CcvII4ZfOQhehs+eVrAI6bO19QBOYUKpnJteanM agent
  debug1: Will attempt key: /home/zzzzz60/.ssh/id_dsa 
  debug1: Will attempt key: /home/zzzzz60/.ssh/id_ecdsa 
  debug1: Will attempt key: /home/zzzzz60/.ssh/id_ecdsa_sk 
  debug1: Will attempt key: /home/zzzzz60/.ssh/id_ed25519 
  debug1: Will attempt key: /home/zzzzz60/.ssh/id_ed25519_sk 
  debug1: Will attempt key: /home/zzzzz60/.ssh/id_xmss 
  debug2: pubkey_prepare: done
  debug3: send packet: type 5
  debug3: receive packet: type 7
  debug1: SSH2_MSG_EXT_INFO received
  debug1: kex_input_ext_info:server-sig-algs=&lt;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&gt;
  debug3: receive packet: type 6
  debug2: service_accept: ssh-userauth
  debug1: SSH2_MSG_SERVICE_ACCEPT received
  debug3: send packet: type 50
  debug3: receive packet: type 51
  debug1: Authentications that can continue: publickey
  debug3: start over, passed a different list publickey
  debug3: preferred gssapi-with-mic,publickey,keyboard-interactive,password
  debug3: authmethod_lookup publickey
  debug3: remaining preferred: keyboard-interactive,password
  debug3: authmethod_is_enabled publickey
  debug1: Next authentication method: publickey
  debug1: Offering public key: /home/zzzzz60/.ssh/id_rsa RSA SHA256:zj5+CcvII4ZfOQhehs+eVrAI6bO19QBOYUKpnJteanM agent
  debug3: send packet: type 50
  debug2: we sent a publickey packet, wait for reply
  debug3: receive packet: type 51
  debug1: Authentications that can continue: publickey
  debug1: Trying private key: /home/zzzzz60/.ssh/id_dsa
  debug3: no such identity: /home/zzzzz60/.ssh/id_dsa: No such file or directory
  debug1: Trying private key: /home/zzzzz60/.ssh/id_ecdsa
  debug3: no such identity: /home/zzzzz60/.ssh/id_ecdsa: No such file or directory
  debug1: Trying private key: /home/zzzzz60/.ssh/id_ecdsa_sk
  debug3: no such identity: /home/zzzzz60/.ssh/id_ecdsa_sk: No such file or directory
  debug1: Trying private key: /home/zzzzz60/.ssh/id_ed25519
  debug3: no such identity: /home/zzzzz60/.ssh/id_ed25519: No such file or directory
  debug1: Trying private key: /home/zzzzz60/.ssh/id_ed25519_sk
  debug3: no such identity: /home/zzzzz60/.ssh/id_ed25519_sk: No such file or directory
  debug1: Trying private key: /home/zzzzz60/.ssh/id_xmss
  debug3: no such identity: /home/zzzzz60/.ssh/id_xmss: No such file or directory
  debug2: we did not send a packet, disable method
  debug1: No more authentication methods to try.
  zzzzz60@github.com: Permission denied (publickey).
  </code></pre>