Need resolution for error: kex_exchange_identification: Connection closed by remote host
Asked by Penchal Modhepalli:

Hi,

Getting below error while accessing the Bitbucket through GitBash and/or IntelliJ IDE

Using Macbook as our personal system.

**kex_exchange_identification: Connection closed by remote host
Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.**


Answers:
author: Penchal Modhepalli
body: Thank you for helping out for this issue. Connected with the our Firewall team for the same and found out that the new tool ZScaler blocks 443 port as well unlike WSS. So they suggested to connect with git using HTTPS instead of SSH.

After making the necessary changes, it started working.

Best regards,

Penchal


author: Muhammad Yusuf
body: [https://community.atlassian.com/t5/Bitbucket-questions/Need-resolution-for-error-kex-exchange-identification-Connection/qaq-p/2025240#M93296:\~:text=edit%20your%20\~/.ssh/config](https://community.atlassian.com/t5/Bitbucket-questions/Need-resolution-for-error-kex-exchange-identification-Connection/qaq-p/2025240#M93296:~:text=edit%20your%20~/.ssh/config)


author: Mark C
body: Hi [@Penchal Modhepalli](/t5/user/viewprofilepage/user-id/4920974)

Welcome to the community.

The error message usually indicates that there's some network disconnection in between.

Would it be possible for you to confirm if you're consistently experiencing the issue?

If not, could you possibly connect to a different ISP/Network connection and see if it works there?  

Let me know how it goes.

Regards,  
Mark C

comments: author: Penchal Modhepalli
body: Hi Mark,

Thanks for your reply. We will check and let you know the status as earliest as possible.

Best regards,

Penchal


author: Mark C
body: Sure and let me know how it goes.  

Regards,  
Mark C


author: artikow
body: hi [@Mark C](/t5/user/viewprofilepage/user-id/1210823) [@Penchal Modhepalli](/t5/user/viewprofilepage/user-id/4920974)

any update on this, I also facing this issue  

\`\`\`  
kex_exchange_identification: read: Connection reset by peer

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.  
\`\`\`  

FYI, I use home internet so I'm not behind any firewall and I can do pull/push on gitlab  

some debug:  
\`\`\`

? ssh -Tv git@bitbucket.org

OpenSSH_8.1p1, LibreSSL 2.7.3

debug1: Reading configuration data /etc/ssh/ssh_config

debug1: /etc/ssh/ssh_config line 47: Applying options for \*

debug1: Connecting to bitbucket.org port 22.

debug1: Connection established.

debug1: identity file /Users/artiko.wibowo/.ssh/id_rsa type 0

debug1: identity file /Users/artiko.wibowo/.ssh/id_rsa-cert type -1

debug1: identity file /Users/artiko.wibowo/.ssh/id_dsa type -1

debug1: identity file /Users/artiko.wibowo/.ssh/id_dsa-cert type -1

debug1: identity file /Users/artiko.wibowo/.ssh/id_ecdsa type -1

debug1: identity file /Users/artiko.wibowo/.ssh/id_ecdsa-cert type -1

debug1: identity file /Users/artiko.wibowo/.ssh/id_ed25519 type -1

debug1: identity file /Users/artiko.wibowo/.ssh/id_ed25519-cert type -1

debug1: identity file /Users/artiko.wibowo/.ssh/id_xmss type -1

debug1: identity file /Users/artiko.wibowo/.ssh/id_xmss-cert type -1

debug1: Local version string SSH-2.0-OpenSSH_8.1

kex_exchange_identification: read: Connection reset by peer

<br />

\`\`\`  

please help me


author: artikow
body: solved, I follow [this](https://stackoverflow.com/a/70979694/6610936) answer on stack overflow

edit your \~/.ssh/config

\`\`\`

Host bitbucket.org  
AddKeysToAgent yes  
HostName altssh.bitbucket.org  
IdentityFile \~/.ssh/id_rsa  
UseKeychain yes  
Port 443

\`\`\`


author: rzky
body: Hi Artiko Wibowo, I assume your Indonesian? I got the same problem when tethering from my phone's Telkomsel 4G network. but the issue went away after I connect to a VPN. I can push just fine now.

So weird. These a\*holes are probably doing something weird with our internet.


author: Fitriaji Taqiy Robbaanii
body: i'm indonesian, i'm using Telkomsel 4G network and got same issue. i try [@artikow](/t5/user/viewprofilepage/user-id/2915193) solution its work for me thank you for him  


author: Bagus Jati Kuncoro
body: ohh god, i never thinking find some answer that just related for indonesian, and WTF, its work, this fucking telkom, always suck,   

hope they dont find us here.


author: consciousness_dev
body: This happened to me today with By.U connection, fixed with [@artikow](/t5/user/viewprofilepage/user-id/2915193) and some changes in line 5,   

UseKeychain yes -\> IgnoreUnknown UseKeychain


author: saefullohmaslul
body: same issue using telkomsel orbit. thanks [@artikow](/t5/user/viewprofilepage/user-id/2915193) its work!


author: Muhammad Yusuf
body: Same issue using all Telkom Product.  
Thank's [@artikow](https://community.atlassian.com/t5/user/viewprofilepage/user-id/2915193) it's work!


author: Babah
body: yupe, same issue with telkomsel product (halo and by.u). thank you for the solution.


author: Ayub
body: oh didn't know this, using VPN works for me too.

I am using the red provider as well :(


author: Fitriaji Taqiy Robbaanii
body: up

not work now, Telkomsel in cilegon :(


author: Wihlarko Prasdegdho
body: this solution currently is not working for By.U

anyone have another solution?

*** ** * ** ***

**update**

my current solution is change git ssh into https (mabye this is not best approach)


author: Babah
body: you need a vpn to access jira site.


author: akhmadrk
body: Thanks artikow its work for me


Tags: bitbucket-cloud

cloud