Missed Team ’24? Catch up on announcements here.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

My ubuntu 16.04 can't reach bitbucket.org on port 22. It never reply.

paolocargnin March 6, 2020

Hi guys!

 

I have a problem with a configuration of a server (that until wendesey worked charmly without me doing anything!) 

Since yesterday, when I try to do git pull or any other try to connect to bitbucket.org, it' never reply. It just stay on waiting until the...end of the world I guess.

Here is some example:

telnet bitbucket.org 22

Return only this: 

Trying 2406:da00:ff00::22e9:9f55...

 

The ssh try commnads: ssh -v git@bitbucket.org

Return this:

OpenSSH_7.2p2 Ubuntu-4ubuntu2.4, OpenSSL 1.0.2g 1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to bitbucket.org [2406:da00:ff00::22c0:3470] port 22.

 

I don't have ufw activated, the firewall on plesk (I'm using plesk odin) doesn't have any rules about bitbucket. I don't have other firewalls to check (I guess). I tried to clone for other ssh repository (example: github.com) and it works. I am 100% sure that isn't a bitbucket problem, but maybe you could help me figure out what can cause this problem?

 

And, forgot to say: Other servers located in the same place of this ones, has no problem conntectin to bitbucket, the server is located in germany and I don't think it's a network connection problem.

1 answer

1 accepted

2 votes
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 6, 2020

Hello @paolocargnin,

Hm, this seems to be an issue with IPv6. SSH prefers IPv6 if it got AAAA record from DNS server. Can you check if it was using IPv6 in the past? Maybe there was some update recently, but IPv6 isn't properly supported by the ISP?

Can you try forcing SSH to use IPv4? Like this:

ssh -v -4 git@bitbucket.org

Hope this helps.

Cheers,
Daniil

paolocargnin March 6, 2020

Omg in this way itworks like a charm! 

Buuuuut, how can I use it with git? 

Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 6, 2020

I can think of following options for a permanent fix, starting from least intrusive:

  • modify SSH command just for Git to enforce IPv4, see git-config
  • enforce IPv4 for SSH by adding a property AddressFamily inet to /etc/ssh/sshd_config
  • disable IPv6 on your machine entirely. I'm not sure about the preferred way of doing this on Ubuntu.
Like paolocargnin likes this
paolocargnin March 9, 2020

Didnt' find a way to do that with git-config. 

I used the second method and worked like a charm ;) 

 

Thank you very much @Daniil Penkin !

Like Daniil Penkin likes this
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 9, 2020

No worries, always happy to help.

One of the ways to set it just for Git:

git config --global --add core.sshCommand "ssh -4"

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events