小编Cos*_*s64的帖子

隧道到相同的端口号

我有一个应用程序连接到同一端口上的多个主机:

a.protected:123
b.protected:123
Run Code Online (Sandbox Code Playgroud)

我无法直接访问它们中的任何一个,但我可以建立一个 ssh 隧道(通过x.accessible)。

如果端口不同,我可以将隧道连接到相同的端口号:

ssh -f me@x.accessible -L 123:a.protected:123 -N
Run Code Online (Sandbox Code Playgroud)

然后我会添加 a.protected 作为 localhost 的别名,在 /etc/hosts

但是考虑到更多主机使用相同的端口号,我有什么选择?如何在不更改应用程序的情况下使用隧道让应用程序连接到它们?

ssh-tunneling

3
推荐指数
1
解决办法
6286
查看次数

标签 统计

ssh-tunneling ×1