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.

Ssh-agent is running. Authentication failed. I cannot push on repos I cloned using git bash.

See original GitHub issue

Following up on: https://github.com/desktop/desktop/issues/7311

Steps to reproduce:

  • In Windows Git Bash do: git clone git@github.com:pressbooks/pressbooks-cas-sso.git
  • Work on files.
  • In GitHub Desktop do: File -> Add Local Repository (CTRL + o)
  • Add the repo.
  • Commit changes.
  • Click the push button.

Expected: Changes are pushed. Actual: Authentication failed.

Important. If I go to the prompt and do git push everything works fine. It’s not a permissions issue. Windows Git Bash is setup and working.

Authentication failed

I’m on Windows. I use ConEmu terminal. The ssh-agent is started using this method:

https://conemu.github.io/en/SshAgent.html#step-by-step

When I start ConEmu it looks like this:

image

This let’s me have multiple Git Bash terminals open, and I don’t have to enter my paraphrase over and over. Once I enter my paraphrase, that tab closes, and ssh-agent is running:

image

https://github.com/desktop/desktop/issues/5641#issuecomment-421801704 is suggesting I force use OpenSSH for Windows build of SSH, but that isn’t what I’m using.

I tried editing .gitconfig

[core]
	sshCommand = 'C:/Program Files/Git/usr/bin/ssh.exe'

I got:

2019-04-18T14:21:06.744Z - info: [ui] [AppStore] loading 39 repositories from store
2019-04-18T14:21:06.745Z - info: [ui] [AppStore] found account: connerbw (Dac Chartrand)
2019-04-18T14:21:06.917Z - info: [ui] launching: 1.6.5 (Windows 10.0.17763)
2019-04-18T14:21:06.918Z - info: [ui] execPath: 'C:\Users\dac\AppData\Local\GitHubDesktop\app-1.6.5\GitHubDesktop.exe'
2019-04-18T14:21:09.226Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: pressbooks - connerbw (has token)
2019-04-18T14:21:09.752Z - error: [ui] `git -c credential.helper= -c protocol.version=2 push origin issue-1640-b --set-upstream --progress` exited with an unexpected code: 128.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

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

(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.)

More screenshots:

image

image

Help?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
hazendazcommented, Jun 7, 2019

Same problem, great write up. I’ve never seen ssh work with this version of github desktop.

0reactions
stevewardcommented, Jan 27, 2020

I’m going to close this issue out since we are tracking SSH improvements in https://github.com/desktop/desktop/issues/2579. If you are still having problems with using SSH in GitHub Desktop try running github from the command line to launch GitHub Desktop – this has fixed various SSH issues for a number of users.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Github ssh-agent cannot push - Stack Overflow
I want to Push changes via SSH to my git repo. git@github.com: Permission denied (publickey). fatal: Could not read from remote repository.
Read more >
Git clone fails when cloning via SSH - Atlassian Documentation
Git clones fail when using ssh even if an Access key has been added to the repository or an SSH key has been...
Read more >
ssh authentication not working with git - RStudio Community
I've set up ssh authentication with an instance of ssh-agent being run from ~/.bashrc on each reboot. Pushing to github from RStudio I...
Read more >
Use SSH keys to communicate with GitLab
Documentation for GitLab Community Edition, GitLab Enterprise Edition, Omnibus GitLab, and GitLab Runner.
Read more >
Xcode 12 git with "ssh://" and pri… | Apple Developer Forums
Test git in a shell (not in Xcode). E.g. "cd /tmp ; git clone ssh://remoteuser@host.com/Users/remoteuser/path/repo.git". Delete ...
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