简体   繁体   English

SSH隧道,端口转发和服务

[英]SSH tunnel, port forwarding and services

I have a doubt about the following system architecture: 我对以下系统架构有疑问:

Lets say we have three machines: 可以说我们有三台机器:

SERVER A
SERVER B
EXTERNAL A

SERVER A is offering some streaming services and its behind an uknown network, so it opens a reverse SSH tunnel to SERVER B on an specified PORT, so SERVER B can access to SERVER A service by http: //localhost:PORT 服务器A提供一些流服务及其后面的未知网络,因此它在指定的PORT上打开到SERVER B的反向SSH隧道,因此SERVER B可以通过http:// localhost:PORT访问SERVER A服务

SERVER B is running linux and openssh server for accepting the tunnel. SERVER B正在运行linux和openssh服务器来接受隧道。 (this server is public) (这个服务器是公共的)

The doubt comes when I want to access the streaming service offered by SERVER A from EXTERNAL A via the public SERVER B. Suposing I know the PORT I'd like to achieve something like: 当我想通过公共服务器B从EXTERNAL A访问服务器A提供的流媒体服务时,怀疑来了。我知道PORT我​​想实现类似的东西:

EXTERNAL A -> 'http: //serverB_IP:PORT' -> SERVERB -> 'http ://localhost/PORT' -> Tunnel -> SERVER A service.

To entangle it even more there could be plenty SERVER A servers which opens a Tunnel with SERVER B (each one on a different port correctly managed). 为了纠缠它,可能有很多SERVER A服务器打开一个带有SERVER B的隧道(每个服务器都在一个正确管理的不同端口上)。

Any idea about how to achieve that? 有关如何实现这一点的任何想法?

if you enable 如果启用

GatewayPorts yes                                                      

in your sshd_config on server b then it is possible to connect from the outside to server b and make use of the established tunnel to server a. 在服务器b上的sshd_config ,可以从外部连接到服务器b,并使用已建立的隧道连接到服务器a。 by default GatewayPorts is disabled and the tunnel will only work locally. 默认情况下,GatewayPorts已禁用,隧道仅在本地运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM