kex_exchange_identification: read: Connection timed out
Asked by Leopold List:

I'm trying to clone one of our repositories, but ssh times out.

I tried to debug ssh, and get the following

```
ssh -vvv -t bitbucket.org
OpenSSH_8.0p1, OpenSSL 1.1.1g FIPS 21 Apr 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 52: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug2: checking match for 'final all' host bitbucket.org originally bitbucket.org
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: not matched 'final'
debug2: match not found
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1 (parse only)
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1-,gss-group1-sha1-]
debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1]
debug1: configuration requests final Match pass
debug1: re-parsing configuration
debug1: Reading configuration data /etc/ssh/ssh_config
debug3: /etc/ssh/ssh_config line 52: Including file /etc/ssh/ssh_config.d/05-redhat.conf depth 0
debug1: Reading configuration data /etc/ssh/ssh_config.d/05-redhat.conf
debug2: checking match for 'final all' host bitbucket.org originally bitbucket.org
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 3: matched 'final'
debug2: match found
debug3: /etc/ssh/ssh_config.d/05-redhat.conf line 5: Including file /etc/crypto-policies/back-ends/openssh.config depth 1
debug1: Reading configuration data /etc/crypto-policies/back-ends/openssh.config
debug3: gss kex names ok: [gss-curve25519-sha256-,gss-nistp256-sha256-,gss-group14-sha256-,gss-group16-sha512-,gss-gex-sha1-,gss-group14-sha1-,gss-group1-sha1-]
debug3: kex names ok: [curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group14-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,diffie-hellman-group1-sha1]
debug2: resolving "bitbucket.org" port 22
debug2: ssh_connect_direct
debug1: Connecting to bitbucket.org [104.192.141.1] port 22.
debug1: Connection established.
debug1: identity file /home/llist/.ssh/id_rsa type -1
debug1: identity file /home/llist/.ssh/id_rsa-cert type -1
debug1: identity file /home/llist/.ssh/id_dsa type -1
debug1: identity file /home/llist/.ssh/id_dsa-cert type -1
debug1: identity file /home/llist/.ssh/id_ecdsa type -1
debug1: identity file /home/llist/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/llist/.ssh/id_ed25519 type 3
debug1: identity file /home/llist/.ssh/id_ed25519-cert type -1
debug1: identity file /home/llist/.ssh/id_xmss type -1
debug1: identity file /home/llist/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.0
kex_exchange_identification: read: Connection timed out
```

I've added my id_ed25519.pub key without any errors, so not sure what's wrong


Answers:
author: Ben
body: Hey Leopold,

The error message shown in your output generally means that there is a connection problem somewhere between your machine and Bitbucket Cloud.

Please add the following IP addresses to your firewall and ensure that port 22 is open to ensure that SSH connections are not being dropped (you can verify this by running ***telnet bitbucket.org 22*** command):  
<https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/>  
Also, do you experience any issues using the HTTPS protocol instead of SSH? Do you mind giving the HTTPS protocol a try?

* You'll first need to create an [App Password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/)and include it in your remote URL The remote URL will look something like this:  
  ***<https://username>:\<appPasswordHere\>@bitbucket.org/workspaceID/reposlug.git***
* Navigate to the repository on your local machine and change the remote URL from SSH to HTTPS  
  ***git remote set-url origin <https://username>:\<appPasswordHere\>@bitbucket.org/workspaceID/reposlug.git***
* Verify that the remote URL has been changed  
  ***git remote -v***   

* Try pulling again  
  ***git pull***

Cheers!

- Ben (Bitbucket Cloud Support)

comments: author: Leopold List
body: Thanks.

I also found that this works for me

git clone ssh://git@altssh.bitbucket.org:443/pcoengineer//gazette.git


Tags: atl-orange

bitbucket-cloud

cloud