1. 在虚拟机(rhel 终端)中:ssh -R 2210:localhost:22 192.168.1.104 -v

1. 在虚拟机(rhel 终端)中:ssh -R 2210:localhost:22 192.168.1.104 -v

我有一个安装了 rhel 的 vmware fusion,我可以从我的 mac ssh 到 rhel。但是当我在 mac 上启用 VPN 时,我无法再 ssh 到 rhel。详情如下:

我尝试了反向 SSH 隧道(http://toic.org/blog/2009/reverse-ssh-port-forwarding/#.U4AOB5SSzjI):

  • 1. 在虚拟机(rhel 终端)中:ssh -R 2210:localhost:22 192.168.1.104 -v

    (它退出并显示“禁止未经授权的使用”的消息。)
  • 2. 在 Mac 中:ssh -p 2210 localhos

以上有效。

然后我在Mac上打开了vpn:

  • 1. 在 vm(rhel 终端)中:ssh -R 2210:localhost:22 192.168.1.104 -v(它退出并显示消息“禁止未经授权使用。”)。

  • 2.在mac中:连接vpn。

  • 3.在 mac 中:ssh -p 2210 localhost。

失败了。“ssh_exchange_identification:远程主机关闭连接”

有人能帮我解决这个问题吗?这很奇怪,因为它通过上述步骤在 mac 10.7 上工作正常,但在我将操作系统升级到 10.9 后,它失败了。

答案1

我假设您连接到与您的虚拟机不同的 VPN 服务器?

也许你通过 vpn 路由了来自 mac 的所有流量。因此你的本地网络不再可访问。如果是这样,你可以尝试取消注释客户端的重定向网关:

#redirect-gateway def1

相关内容