4

Nothing was changed in the system. I work as usually. And usually there was no any problems with pull/push. I have access on bitbucket, if I visit it via the browser.

And now when I try to push or pull from bitbucket repository, I get error:

ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights

Below is a command with verbose output, but I cannot understand what is the problem.

Command used for verbose output: $ GIT_SSH_COMMAND="ssh -vvv" git pull

The output:

OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/volk/.ssh/config
debug1: /Users/volk/.ssh/config line 48: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug2: resolving "bitbucket.org" port 22
debug2: ssh_connect_direct
debug1: Connecting to bitbucket.org [18.205.93.2] port 22.
debug1: Connection established.
debug1: identity file /Users/volk/.ssh/id_rsa type 0
debug1: identity file /Users/volk/.ssh/id_rsa-cert type -1
debug1: identity file /Users/volk/.ssh/id_dsa type -1
debug1: identity file /Users/volk/.ssh/id_dsa-cert type -1
debug1: identity file /Users/volk/.ssh/id_ecdsa type -1
debug1: identity file /Users/volk/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/volk/.ssh/id_ed25519 type -1
debug1: identity file /Users/volk/.ssh/id_ed25519-cert type -1
debug1: identity file /Users/volk/.ssh/id_xmss type -1
debug1: identity file /Users/volk/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.9
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
Sergej
  • 2,030
  • 1
  • 18
  • 28
  • I do not know what has happened, nothing changed, but it now works back again. – Sergej Feb 27 '20 at 19:48
  • Alright. It was Bitbucket problem. here is more info: https://bitbucket.status.atlassian.com/incidents/jbvzjz4yldss – Sergej Feb 27 '20 at 19:51

3 Answers3

3

Got same issue today.

Fixed the issue via add following lines in ssh config(vim ~/.ssh/config)

Host bitbucket.org
  AddKeysToAgent yes
  HostName altssh.bitbucket.org
  IdentityFile ~/.ssh/id_rsa
  UseKeychain yes
  Port 443
Zilong Wang
  • 564
  • 4
  • 14
1

It might be a problem with Bitbucket.

Check Bitbucket status https://bitbucket.status.atlassian.com/history


That's what happened to me and the original poster, but I didn't think to check until seeing the comment on the question here.

0

I also faced a similar issue all of a sudden. I tried of couple of suggestions given in ssh_exchange_identification: Connection closed by remote host under Git bash but the following one worked for me.

  1. Delete ssh folder (~/.ssh)
  2. Recreate .ssh using ssh-keygen
  3. Configure the latest public key
  4. Then now try your git commands
grg
  • 5,023
  • 3
  • 34
  • 50