git-plus icon indicating copy to clipboard operation
git-plus copied to clipboard

[QUESTION] Fatal: could not read from remote repository, SSH issue?

Open jmcweeney opened this issue 9 years ago • 12 comments

Atom plus git-plus has made life so much easier. Yet, after the recent macOS Software Update (10.12.2) git-plus is having trouble reaching my remote OpenShift git repository.

Steps to reproduce:

git push results in:

Permission denied (publickey,gssapi-keyex,gssapi-with-mic). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

Wonder if this is an SSH issue, but I'm able to successfully push (to this repository) from the terminal and another app. Any insights you have would be greatly appreciated! Thanks!

jmcweeney avatar Dec 23 '16 14:12 jmcweeney

I have same problem

muhyiddins avatar Dec 23 '16 18:12 muhyiddins

I'm at a loss. I've uninstalled the git-plus package, reinstalled Atom, even dumped the .atom/ folder, but nothing has helped so far.

jmcweeney avatar Dec 23 '16 19:12 jmcweeney

Do you have ssh setup so it doesn't require you to enter your credentials? That's the first thing to check because currently the package favors an ssh setup like that because you can't enter input to the git commands.

I plan to update to MacOs Sierra in the next couple of days and maybe I'll have the same experience

akonwi avatar Dec 24 '16 01:12 akonwi

Yes, all OpenShift is handled with ssh, no credentials required. For example, if I use Terminal to git push it requires my credentials.

Right on, let me know how it goes. Thanks for responding! Cheers and happy holidays!

jmcweeney avatar Dec 24 '16 21:12 jmcweeney

I'm unfamiliar with OpenShift and I don't think I fully understand what your setup is. What stands out to me in your response though is that pushing from the terminal requires you to enter your credentials, which would also be true with this package as well. The package is spawning a shell process to execute git commands so the behavior will be the same as in the terminal. So if you do need to enter your credentials from the terminal, that is probably the source of the problem.

akonwi avatar Dec 25 '16 00:12 akonwi

I think this annoyance may be related by recent macOS 10.12 Sierra changes to ssh. See this stackoverflow thread for more info.

TL;DR workaround:

Basically, ssh-add -K needs to be run after every reboot. To avoid this, create ~/.ssh/config with the following content:

Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_rsa

icflorescu avatar Dec 27 '16 14:12 icflorescu

Thanks @icflorescu!

I just upgraded to Sierra and had the same problem. ssh-add -K seems to be the current solution.

akonwi avatar Dec 27 '16 19:12 akonwi

You're welcomed, @akonwi, and thanks for doing an extraordinary job with git-plus! One of the most useful atom plugins out there, definitely.

Be advised that ssh-add -K only solves the problem until the next boot, while adding the .ssh/config solves it permanently.

icflorescu avatar Dec 27 '16 20:12 icflorescu

Thanks @icflorescu this worked like a charm. Will need to give ~/.ssh/config a try.

jmcweeney avatar Jan 03 '17 18:01 jmcweeney

Have to thank @icflorescu after going round in circles for ages trying to solve this!

alistairjackman avatar Jan 29 '18 14:01 alistairjackman

I am new to Atom and fear that I not installed everything I need. Atom will neither push or pull. I am running MacOS 10.13.4. I installed apm install and restarted atom. I logged into Atom and evrything looks good.

<PJO:~ PJO$ ~/.ssh/config -bash: /Users/PJO/.ssh/config: No such file or directory>

<PJO:PJOssenbruggen.github.io PJO$ ssh-add -K Enter passphrase for /Users/PJO/.ssh/id_rsa: > I don't know where to get the id.

I pushed changes from my Mac to GitHub with Atom. The wheel spins and gives no indication that it is not working.

Any help would be appreciated.

PJOssenbruggen avatar Apr 03 '18 19:04 PJOssenbruggen

I ' ve came into this problem for ages. Nothing had happend after trying this things...

CaptXiong avatar Nov 13 '19 11:11 CaptXiong