Fatal: The remote end hangs up unexpectedly by connecting to GitHub

I installed my local system to work with GitHub, as described in Creating SSH keys . How-to.

Key files and known_hosts are created, the public key is added to the GitHub account, and I get the message "Hello ***! You have successfully authenticated, but GitHub does not provide access to the shell."

enter image description here

But all my attempts to do something that is needed to connect to the server (EDIT: with write access) are git clone, git push, etc. - ends with an error:

fatal: the far end unexpectedly hung up

EDIT:

I can clone, but only through HTTP ( https://github.com/account/reponame.git ) or git Read only (git: //github.com/account/reponame.git).

EDIT:

***@**** ~/.ssh $ ssh-add -l Could not open a connection to your authentication agent. 

Although the ssh-agent daemon ( ssh-agent.exe ) ssh-agent.exe .

Perhaps this is a problem.

+4
source share
2 answers

It works!

I launched Pageant (PuTTY SSH authentication agent) and added the PuTTY private key id_rsa.pkk (exported from PuTTYgen (PuTTY key generator) from id_rsa ) to it. Now I can write my repositories.

A small guide for everyone who had the same problems:

0) Configure the local system to work with GitHub, as described in Creating SSH keys . How-to.

1) Open PuTTYgen , load / import the private key (OpenSSH) id_rsa and save it ( Save private key button) as id_rsa.pkk (in the same folder where id_rsa saved, ~/.ssh ). You need this PuTTY version of the key to authenticate PuTTY with Pageant and (if you use it) TortoiseGit.

enter image description here

2a) Open Pageant (on my computer it is C:\Program Files (x86)\PuTTY\pageant.exe ) and add the private key PuTTY. Or simply open the PuTTY private key file ( id_rsa.pkk ) with Pageant .

2b) For TrtoiseGit, I needed to install the SSH client ( C:\Program Files (x86)\Git\bin\ssh.exe ) in the global TrtoiseGit settings.

enter image description here

What is it.

It works for me, but I do not have a deep understanding of this thema and cannot provide a low explanation of the level of solution and the cause of this problem (and, for example, why it works for some clients and was not in some others). So feel free to edit / comment on this post if you can explain it all better.

+2
source

The only instance where this error message appears and your public ssh key is correctly written by GitHub is when

  • You are trying to clone a repo with the wrong case or the wrong ssh url.
    It should be:
  git clone git@github.com : user / repo.git 
  • you are trying to clone a repo for which you do not have write access (public repo) or any access (private repo).
    From the GitHub " Which Remote URL Should I Use? "

To use these URLs , you must have write access to the public repo or any access to the private repo .
These URLs will not work with a public repo to which you do not have write access.

  • the private key is protected by a passphrase and your authentication agent is not working correctly:
  $ ssh-add -l
 Could not open a connection to your authentication agent. 

In the latter case, consider How to run the (git / ssh) authentication agent? "or" ssh-add complains: Could not open connection with your authentication agent "

+2
source

All Articles