【问题标题】:Connecting to Bitbucket using ssh through proxy通过代理使用 ssh 连接到 Bitbucket
【发布时间】:2015-10-26 17:54:39
【问题描述】:

我已经用完了所有选项。我尝试了几种方法,但都没有奏效,所以我希望有人能帮助我。

在工作中,我们在代理后操作;目前我正在设置一个我想从中提取和推送的存储库。我想使用 ssh 进行此操作,因此我在工作时或在家带笔记本电脑时不需要密码。

存储库已创建。 我创建了一个额外的不同 ssh 密钥并将其添加到 bitbucket 设置配置文件中。 我已经使用以下命令加载了 ssh 密钥 - ssh-add ~/.ssh/personal 我已经检查并加载了密钥。

当我尝试使用克隆或任何其他操作(推送或拉取)连接到我的存储库时,它不起作用

操作超时 致命:无法从远程存储库读取。

请确保您拥有正确的访问权限 并且存储库存在。

我还尝试使用以下值在 .ssh/ 中创建配置文件

主机个人ID 主机名 bitbucket.org 身份文件 ~/.ssh/personal

但还是不行

我不知道是代理问题还是其他问题,我认为 ssh 应该允许我绕过所有内容。

有人可以告诉我如何诊断问题吗?

谢谢

=========

更新:ssh -Tv hg@bitbucket.org 命令的结果

   ssh -Tv hg@bitbucket.org
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/username/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to bitbucket.org [131.103.20.167] port 22.
debug1: connect to address 131.103.20.167 port 22: Operation timed out
debug1: Connecting to bitbucket.org [131.103.20.168] port 22.
debug1: connect to address 131.103.20.168 port 22: Operation timed out
ssh: connect to host bitbucket.org port 22: Operation timed out

=========

If i use port 443

ssh -Tv -p 443 hg@bitbucket.org
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/username/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to bitbucket.org [131.103.20.167] port 443.
debug1: connect to address 131.103.20.167 port 443: Operation timed out
debug1: Connecting to bitbucket.org [131.103.20.168] port 443.
debug1: connect to address 131.103.20.168 port 443: Operation timed out

ssh:连接到主机 bitbucket.org 端口 443:操作超时

when trying ssh -Tvp443 hg@altssh.bitbucket.or
ssh -Tvp443 hg@altssh.bitbucket.org
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/username/.ssh/config
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: Connecting to altssh.bitbucket.org [131.103.20.174] port 443.
debug1: connect to address 131.103.20.174 port 443: Operation timed out
ssh: connect to host altssh.bitbucket.org port 443: Operation timed out

【问题讨论】:

  • 嘿,伙计,您最终在这方面取得了多大进展?我遇到了同样的问题,我觉得我快到了但放弃了,因为我遇到了一个我无法弄清楚的愚蠢错误。不过,我发现的内容可能会对您有所帮助。首先是这个 git 配置:gist.github.com/daicham/10253947 第一行引用的 connect.exe 也被提及,可以在另一篇有用的文章中下载:returnbooleantrue.com/2009/06/…。希望这至少可以帮助某人。

标签: proxy


【解决方案1】:

最好的诊断方法是伪造 SSH 会话:

ssh -Tv hg@bitbucket.org

(无论您使用的是 Git 还是 Mercurial,此测试的效果都是一样的。)

多亏了-v,命令会有一堵输出墙,但首先要查找的是最后一行带有您的特定用户名的行:

logged in as cpu2007.

这将确定 a) 您正在访问 Bitbucket 并且 b) 您的密钥已添加到您的帐户中。如果您没有看到这样的线条,那么这应该可以帮助您诊断问题。

【讨论】:

  • 我之前测试过这些命令,但没有运气。我在代理后面,我需要知道如何绕过该代理,但不知道如何设置它。
  • 如果你尝试ssh -Tvp443 hg@altssh.bitbucket.org会发生什么?
猜你喜欢
  • 2011-01-04
  • 1970-01-01
  • 1970-01-01
  • 2013-10-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-09-07
相关资源
最近更新 更多