question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Authentication failed when pushing to my repository

See original GitHub issue

Description

I have a repository that I have used for several months, and suddenly last week I was unable to push my changes. The client shows the following error: Authentication failed. You may not have permission to access the repository or the repository may have been archived. Open options and verify that you're signed in with an account that has permission to access this repository. I tried signing out and in again, and still the same issue. I did Repository > Open in Command Prompt and git push which gave me a slightly more detailed error:

FATAL ERROR: Couldn't agree a key exchange algorithm (available: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521)
fatal: Could not read from remote repository.

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

Version

GitHub Desktop version: 1.0.13

OS version: Microsoft Windows [Version 10.0.16299.248]

Steps to Reproduce

  1. Start GitHub client
  2. Try to push a changeset
  3. 😞

Expected behavior: Pushes successfully

Actual behavior: Failed to push

Reproduces how often: 100%

Logs

(The error was parsed as 2: Authentication failed. You may not have permission to access the repository or the repository may have been archived. Open options and verify that you're signed in with an account that has permission to access this repository.)
2018-02-26T00:13:35.744Z - error: [ui] `git -c credential.helper= fetch --progress --prune origin` exited with an unexpected code: 128.
FATAL ERROR: Couldn't agree a key exchange algorithm (available: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521)
fatal: Could not read from remote repository.

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

This section is repeated for each of my failed attempts to sync.

Additional Information

Update: I suspected an old version of PuTTY was the problem (0.66) but upgrading to the latest (0.70) didn’t help.

Update 2: Still suspecting PuTTY to be related. I deleted the entry for github.com in registry Computer\HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\SshHostKeys and did putty github.com to add it back. Then I got a different error when trying git push:

FATAL ERROR: Disconnected: No supported authentication methods available (server sent: publickey)
fatal: Could not read from remote repository.

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

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:8
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

16reactions
NichUKcommented, Mar 6, 2018

I’m also having the same problem. I’ve tried updating PUTTY, Git Extensions, deleting all my keys from Github and re-adding, re-adding github.com fingerprint, but I still can’t get access to push to my repo. What can I do? I just need to push code!

FATAL ERROR: Couldn’t agree a key exchange algorithm (available: curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521) fatal: Could not read from remote repository.

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

13reactions
NichUKcommented, Mar 8, 2018

My problem turned out to be an old version of Putty that was bundled with Git Extensions. If you’ve got the latest Putty installed then make sure you don’t have a second version installed somewhere else which is being found. If you don’t have the latest Putty, upgrade.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git push results in "Authentication Failed" - Stack Overflow
If you enabled two-factor authentication in your GitHub account you won't be able to push via HTTPS using your accounts password.
Read more >
GitHub Authentication Failure when Clone, Fetch, Pull and Push
If you can directly login to the Github with the username and password, the issue might be mostly with Two Factor Authentication (2FA)....
Read more >
github respiratory authentication failed · Discussion #29193
As the error message says you cannot use your password for git push or other Git operations (but you still need it to...
Read more >
Git Commands Return Fatal: Authentication Failed
There is an Apache proxy server in front of Bitbucket Server that is removing the authorization header information as the request is passed...
Read more >
Fix Git error “fatal: Authentication failed” - LinuxPip
Usually, the “Authentication Failed” error happens if you recently enabled 2-Factor Authentication on your GitHub account and uses HTTPS to push ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found