Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ssh: connect to host bitbucket.org port 22: Connection timed out fatal

Whole error is:

ssh: connect to host bitbucket.org port 22: Connection timed out
fatal: The remote end hung up unexpectedly

I'm getting this error when I do push from two of my projects which are on different servers (countries).

What could be problem?

UPDATE:

Using

ssh -v

I'm getting this:

usage: ssh [-somecode] [-b bind_address] [-c cipher_spec]
           [-D [bind_address:]port] [-e escape_char] [-F configfile]
           [-i identity_file] [-L [bind_address:]port:host:hostport]
           [-l login_name] [-m mac_spec] [-O ctl_cmd] [-o option] [-p port]
           [-R [bind_address:]port:host:hostport] [-S ctl_path]
           [-w tunnel:tunnel] [user@]hostname [command]
like image 726
iWizard Avatar asked Jul 24 '13 06:07

iWizard


People also ask

How do I enable SSH in bitbucket?

To enable SSH access:Go to the Bitbucket Server administration area and click Server settings (under 'Settings'). Under 'SSH access', check SSH enabled. Enter values for SSH port and SSH base URL, according to the information in the sections below. Click Save.

What is SSH in bitbucket?

You can use SSH keys to establish a secure connection between your computer and Bitbucket Data Center and Server for when you are performing Git operations (pull, clone, push) from your local machine.


2 Answers

This may get it working again

edit the ssh config file:

nano ~/.ssh/config

make sure you have these lines:

Host bitbucket.org
 Hostname  altssh.bitbucket.org
 Port  443
like image 182
Mark Aroni Avatar answered Sep 21 '22 03:09

Mark Aroni


check if you don't have iptable rules for ssh outgoing connections, if true, add port 22.
For multiple ports:

iptables -t filter -A OUTPUT -p tcp --match multiport --dport 22,1111,2222,3333 -j ACCEPT
like image 28
Quiche Avatar answered Sep 22 '22 03:09

Quiche