【问题标题】:Rails, Capistrano 3 and SSH agent forwardingRails、Capistrano 3 和 SSH 代理转发
【发布时间】:2013-12-17 09:44:30
【问题描述】:

初始状态:

1) 我有电脑,只能访问本地服务器(ssh deployer@localserver 可以工作,ssh git@github.com 不行)。

2)我有本地服务器(上面提到的),可以访问互联网(ssh git@github.com 正在工作)

3) 我需要使用 Capistrano 通过此本地服务器从 PC 部署我的 Rails 应用程序。

我已阅读SSH-agent-forwarding 主题,这是我的情况:

我想要什么:

我想通过 ssh 从 PC 访问我的 VPS,如下所示:

ssh ubuntu@ec2-...#.com. 

我该怎么做?可能我的 ~/.ssh/config 中需要一些东西?

【问题讨论】:

    标签: ruby-on-rails git ssh proxy capistrano


    【解决方案1】:

    我找到了解决办法:

    在 ssh/config 文件中我们应该放置以下内容:

    Host github.com
    Hostname github.com
    ProxyCommand ssh -q deployer@localservername nc -q0 %h 22
    User git
    

    除了 github.com 之外,还可以有另一个主机或只是 (*):

    Host *
    ProxyCommand ssh ....
    

    this(transparent-multihop-ssh) 也是关于这个问题的非常有用的链接。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-07-03
      • 1970-01-01
      • 2012-08-20
      • 2015-07-09
      • 1970-01-01
      • 2012-02-02
      • 2014-07-14
      • 2014-02-26
      相关资源
      最近更新 更多