ssh: connect to host bitbucket.org port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
My firewalls are disabled and I still get connection time out. What should I do?
Looks like you have issues with the default SSH port and they could be avoided by using another port. This is a common issue.
Basically, you can use port 443 instead of 22.
To set this in your ssh config, edit the file at ~/.ssh/config, and add this section:
Host github.com Hostname ssh.github.com Port 443
BitBucket: Answers below confirmed you can still do this even though it was supposed to be discontinued on June 15, 2011:
Host bitbucket.org
Hostname altssh.bitbucket.org
Port 443
For Gitlab, the ssh config looks like this. Update the IdentityFile to match your local private key:
Host gitlab.com
Hostname altssh.gitlab.com
User git
Port 443
PreferredAuthentications publickey
IdentityFile ~/.ssh/gitlab
Sources:
https://about.gitlab.com/2016/02/18/gitlab-dot-com-now-supports-an-alternate-git-plus-ssh-port/
https://help.github.com/en/articles/using-ssh-over-the-https-port
https://confluence.atlassian.com/bitbucketserver/enabling-ssh-access-to-git-repositories-in-bitbucket-server-776640358.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With