2016/08/22

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

今天要上傳程式碼到Bitbucket上沒想到出現了ssh: connect to host bitbucket.org port 22: Connection timed out
解決方式有三種

#1
#改用Https協定
#編輯git設定檔
git config --local -e

#將url修改為https
#url = https://UserName@bitbucket.org/UserName/repository.git

#2
#將22Port改為443
vi ~/.ssh/config

#將下列貼到config內
Host bitbucket.org
  Hostname ssh.bitbucket.org
  Port 443

#用下列指令測試是否連線正確
ssh -T -p 443 git@bitbucket.org

#3
#打給你的ISP請他重新分配一組IP給你