Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication failed when pushing to my repository #4105

Closed
francisrath opened this issue Feb 26, 2018 · 15 comments

Comments

@francisrath
Copy link

commented Feb 26, 2018

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.
@iAmWillShepherd

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2018

I'm sorry you're experiencing this issue.

This may be related to us removing support for TLSv1 (see this for more info).

@francisrath

This comment has been minimized.

Copy link
Author

commented Feb 26, 2018

Thanks, I just saw the linked post after looking through a few recent issues here.

Any ideas what I can do to fix it? I already have the latest GitHub Desktop and PuTTY versions.

@iAmWillShepherd

This comment has been minimized.

Copy link
Contributor

commented Feb 26, 2018

Try following the steps outlined in this comment.

@francisrath

This comment has been minimized.

Copy link
Author

commented Feb 26, 2018

It worked when I deleted all my private keys from GitHub.com and then re-added public key for the same key I used before. Strange...

@NichUK

This comment has been minimized.

Copy link

commented 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.

@shiftkey

This comment has been minimized.

Copy link
Member

commented Mar 6, 2018

@NichUK please also try updating your Git for Windows installation. If you're still unable to push, Git for Windows is the place to report an issue.

@sdavila604

This comment has been minimized.

Copy link

commented Mar 7, 2018

I had to upgrade my keys to ED25519 which are apparently stronger.

@pvcraven

This comment has been minimized.

Copy link

commented Mar 8, 2018

Unfortunately pageant doesn't seem to support ED25519.

@sdavila604

This comment has been minimized.

Copy link

commented Mar 8, 2018

Interesting, I downloaded PuTTY yesterday and it included PuTTYgen with the ED25519 option. Pageant seems to support it (Windows 7 64bit):

puttygen

@NichUK

This comment has been minimized.

Copy link

commented 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.

@0x022b

This comment has been minimized.

Copy link

commented Mar 15, 2018

I had the same issue with GitExtensions although I had it configured to use separately installed PuTTY 0.70. Instead of using plink.exe from the path in the SSH settings, GitExtensions was using the bundled version. After renaming C:\Program Files (x86)\GitExtensions\PuTTY to C:\Program Files (x86)\GitExtensions\PuTTY2 and redefining the paths in SSH settings it started to work.

@brazorf

This comment has been minimized.

Copy link

commented May 30, 2018

I'm late to the party but i've also struggled with this (i'm not using any extension though, just command line).

My problem was related to a probably outdated TortoisePlink.exe that i think was bundled with git for windows. What i did was to

  • download the latest plink.exe here https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
  • edit GIT_SSH environment variable and make sure it points to plink.exe
  • close any shell, terminal, ide, etc. because they cache the env variables
  • open putty and make a ssh connection to git@github.com, so you'll get eventually prompted the fingerprint window, check the data and press Y, then close putty

The last step is required because apparently there's something weird happening between git bash and plink.exe so that when the terminal is asking Store key in cache? (y/n), your keyboard input won't be piped properly and your compulsive 'Y' strokes will be lost in the empty void.

If you are having a similar issue, you should see a popup window with this message

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.

if you didn't get this fixed with any of the above suggestion then open task manager while that popup is still opened, search the window name in the applications list, then right click and "go to process", then right click the process and "go to file". Your problem most likely is in that very file. Cheers.

@Sprachprofi

This comment has been minimized.

Copy link

commented Jul 11, 2018

Had the same issue. I generated a ED25519 key, then had to manually add it to PuTTY Pageant and update the .ssh/config file which was pointing at an outdated key for github.com

@lock lock bot locked as resolved and limited conversation to collaborators Sep 9, 2018

@desktop desktop unlocked this conversation Sep 27, 2018

@fend25

This comment has been minimized.

Copy link

commented Feb 16, 2019

Was using source tree 2.3. Same error on git pull. While the usual console git works fine.
Reuploaded the public key, updated the most modern plink and pageant, restarted, nothing.
Updated the source tree to 3.0, and it has started working.

@korabelnikov

This comment has been minimized.

Copy link

commented May 23, 2019

I expirienced same problem
FATAL ERROR: Couldn't agree a key exchange algorithm (available: curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521)
I've just changed ssh clien to openssh

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.