title: Authentication failed when pushing to a repository on GitHub (from GitHub Desktop and command line)
body: <ul>
  <li>I am using GitHub Desktop v2.5.7 and Git v2.29.1 on Windows 10 64 bit.</li>
  <li>My GitHub account has <a href="https://en.wikipedia.org/wiki/Two-factor_authentication" rel="nofollow noreferrer">2FA</a> enabled.</li>
  <li>I can clone repositories from GitHub using the GitHub Desktop or command line</li>
  <li>I have generated an SSL key and followed all instructions to add it locally and to GitHub</li>
  <li>I have generated a personal access token and tried using this in the command line, and also my password</li>
  </ul>
  <p><strong>Problem: When I attempt to push changes to a repository I get an authentication error.</strong></p>
  <p>Error in GitHub Desktop:</p>
  <p><a href="https://i.stack.imgur.com/tBCSw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tBCSw.png" alt="Screenshot of error - authentication failed. Some common reasons include..." /></a></p>
  <p>Error in command line:</p>
  <p>With sslverify turned on:</p>
  <blockquote>
  <p>fatal: unable to access 'https://github.com/jacquibo/neo4jDataSets.git/': SSL certificate problem: unable to get local issuer certificate</p>
  </blockquote>
  <p>With sslverify turned off:</p>
  <blockquote>
  <p>info: please complete authentication in your browser... <br />
  fatal: incorrect_client_credentials: The client_id and/or client_secret passed are incorrect. [https://docs.github.com/apps/managing-oauth-apps/troubleshooting-oauth-app-access-token-request-errors/#incorrect-client-credentials] <br />
  Username for 'https://github.com': my@githubemail.co.uk <br />
  Password for 'https://my@githubemail.co.uk@github.com': <br />
  remote: No anonymous write access. <br />
  fatal: Authentication failed for 'https://github.com/myusername/myrepo.git/'</p>
  </blockquote>
  <p>I have tried:</p>
  <ul>
  <li>all the suggestions in the error in GitHub</li>
  <li>adding an SSH key locally and on GitHub (when I use <code>ssh -i mycertname -vT git@github.com</code> I get a permission denied message, see below)</li>
  <li>adding a personal access token</li>
  <li>checking origin is using HTTPS</li>
  </ul>
  <p>Error using the command line to test SSL certificate:</p>
  <blockquote>
  <p>OpenSSH_8.4p1, OpenSSL 1.1.1h  22 Sep 2020 <br />
  debug1: Reading configuration data /etc/ssh/ssh_config <br />
  debug1: Connecting to github.com [140.82.121.4] port 22. <br />
  debug1: connect to address 140.82.121.4 port 22: Permission denied <br />
  ssh: connect to host github.com port 22: Permission denied</p>
  </blockquote>
  <p>How can I fix this problem?</p>
  <p>Only being able to edit files actually on GitHub.com is not very practical.</p>