【问题标题】:ssh: connect to host bitbucket.org port 22: Connection timed out fatalssh:连接到主机 bitbucket.org 端口 22:连接超时致命
【发布时间】:2013-07-24 06:23:15
【问题描述】:

整个错误是:

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

当我从位于不同服务器(国家/地区)上的两个项目推送时出现此错误。

可能有什么问题?

更新:

使用

ssh -v

我明白了:

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]

【问题讨论】:

  • 使用 ssh -v (或 -vv, -vvv, ...)
  • @golimar - 我通过终端在 mac mac 上通过 ssh 连接。
  • 所以你使用的是 ssh 命令?那么你应该可以做'ssh -v'
  • 那个命令是做什么的?
  • @CroiOS 当我尝试使用不正确的帐户/公钥连接到 bitbucket 时,我看到了这个问题。很可能是公钥/私钥文件问题

标签: ssh push bitbucket


【解决方案1】:

这可能会让它再次工作

编辑 ssh 配置文件:

nano ~/.ssh/config

确保你有这些行:

Host bitbucket.org
 Hostname  altssh.bitbucket.org
 Port  443

【讨论】:

  • 效果很好。但是我必须删除端口号 443 之后的反引号(在 MacOS 上)。
  • 好发现,不应该在里面,我现在已经编辑并删除了它,谢谢
【解决方案2】:

检查您是否没有用于 ssh 传出连接的 iptable 规则, 如果为真,则添加端口 22。
对于多个端口:

iptables -t filter -A OUTPUT -p tcp --match multiport --dport 22,1111,2222,3333 -j ACCEPT

【讨论】:

  • 它确实对我有用,但你能解释一下这到底是做什么的吗?
【解决方案3】:

检查bitbucket是否关闭

  1. 打开浏览器
  2. 转到http://www.bitbucket.org
  3. 如果页面不显示,则表示 bitbucket 已关闭。

解决方案:等待它:)

【讨论】:

  • 如果第三条语句为假怎么办?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2015-09-17
  • 2013-03-13
  • 1970-01-01
  • 1970-01-01
  • 2022-01-01
  • 1970-01-01
相关资源
最近更新 更多