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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,409,324
Community Members
 
Community Events
169
Community Groups

SSH not working intermittently

Edited

I was having trouble with git pull/push commands hanging intermittently. Trying to get to the root cause I ran ssh -T git@bitbucket.org. Sometimes it says I've been authenticated successfully and sometimes it just hangs. This leads me to believe my SSH key is set up properly so I'm not sure what would cause it to randomly not work and then start working again. As a side note, ssh -T git@github.com comes back successfully and never hangs, so I don't think it's some general SSH problem with my machine or network.

 

As I was writing this, one of the ssh -T git@bitbucket.org commands just came back but it took quite a while, on the order of minutes. Can anyone shed some light as to why it is so slow to respond for me?

 

EDIT: I ran ssh -Tvv git@bitbucket.org and I see the following: debug1: connect to address 2401:1d80:1010::150 port 22: Connection timed out

 

After that it looks like it attempts to connect again: debug1: Connecting to bitbucket.org [104.192.143.3] port 22. this time the connection is established immediately

2 answers

1 accepted

9 votes
Answer accepted
jredmond Atlassian Team Jul 20, 2018

That explains a lot, actually. Modern operating systems prioritize IPv6 traffic over IPv4 traffic, so if the IPv6 route is invalid or experiencing difficulty then the IPv4 connection will be delayed. You aren't experiencing this on Github because they still don't support IPv6.

As a short-term measure, you can add this to your ~/.ssh/config:

Host bitbucket.org
AddressFamily inet

That will instruct your SSH client to use only IPv4 when talking to Bitbucket.

Quick response, works perfectly! This is why Atlassian are the best; best products and best support.

 

Many thanks!

I was having the same issue. Thanks for the explanation in addition to the solution!

This was the solution for me. I was using bitbucket via ssh and this configuration solved the issue.

Thanks!

soaresr I'm New Here Oct 24, 2022

Solved it for me, thanks!

I have this exact same issue today, after months of using git over ssh to work on the same repo. Almost exactly two years since this was reported 🤔

The fix seems to work sometimes, but others it gets really slow. I start digging onto this because git push was hanging, then I try with ssh with this result:

$ ssh -T -v git@bitbucket.org
OpenSSH_8.1p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/brunoberisso/.ssh/config
debug1: /Users/brunoberisso/.ssh/config line 7: Applying options for bitbucket.org
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/brunoberisso/.ssh/id_rsa.expero type 0
debug1: identity file /Users/brunoberisso/.ssh/id_rsa.expero-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.1

|
|
hangs here for a couple of minutes, then continues with success.

 

Forcing inet address family might alleviate the issue, I can't really tell because the daily seems random.

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events