Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to fix the "git ssh host cannot connect to bitbucket.org port 22 network" error?

Buğra Han YILMAZ
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 25, 2023

Even though I am logged in to the bitbucked plugin in VSCode, I cannot pull or push code. 

I encounter the error "git ssh host cannot connect to bitbucket.org port 22 network".

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 26, 2023

Hello @Buğra Han YILMAZ and welcome to the Community!

The Bitbucket plugin in VSCode is a tool that you can use to see your Pull Requests, Pipelines, and Issues, but the authentication for the VSCode plugin is different than the git authentication when you pull or push code.

That being said, from the description of the issue it seems like the port 22 is blocked on your network, which is causing the connection to fail. If that is the case, I would suggest following the instructions in the article below to try the alternative endpoint ssh://git@altssh.bitbucket.org:443 as it will use port 443 instead of 22

In case it doesn't work either, I would suggest testing the clone outside of VSCode in a terminal session using the command below: 

GIT_TRACE_PACKET=1 GIT_TRACE=1 GIT_SSH_COMMAND="ssh -vvv" git clone git@bitbucket.org:<workspace>/<repository>.git

This will include verbose logs that can help in investigating if the SSH configuration is setup correctly in your machine. You can share the full log output with us, making sure to sanitize any sensitive information, as this is a public forum.

Should you have any questions, let us know!

Thank you, @Buğra Han YILMAZ !

Patrik S

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
TAGS
AUG Leaders

Atlassian Community Events