Dar*_*bio 21 ssh port-forwarding putty
使用 Putty,我设置了一个反向代理,它允许我在服务器的端口 8080 上连接server.tld到启动 SSH 连接的机器的端口 80。
服务器允许我连接localhost:8080并返回initiator:80我在服务器上连接时的结果。
这个问题说要启用 GatewayPorts 并绑定到所有地址。
使用 Putty,如何在服务器上公开端口 8080,以便当外部接口(例如 Web 请求)上的请求通过时,端口被转发到initiator:80?

Eig*_*ony 22
设置 PuTTY 隧道时有两个复选框,
其中的第二个做你需要的。
我刚刚测试了一下
PuTTY 隧道对话框,
工作正常,这是生成的 netstat,
# netstat -an | grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp6 0 0 :::8080 :::* LISTEN
Run Code Online (Sandbox Code Playgroud)
您也可以使用 PuTTY 自带的 plink.exe,例如,
plink -R *:8080:localhost:80 user@remote.host.example
Run Code Online (Sandbox Code Playgroud)
这也很好用。
# netstat -an | grep 8080
tcp 0 0 0.0.0.0:8080 0.0.0.0:* LISTEN
tcp6 0 0 :::8080 :::* LISTEN
Run Code Online (Sandbox Code Playgroud)
如果您仍然在主机上收到 127.0.0.1:8080,则 sshd 配置中的 GatewayPorts 仍设置为 no。
另外,不要忘记更新目标服务器上的防火墙以允许外部连接到端口 8080。
| 归档时间: |
|
| 查看次数: |
62545 次 |
| 最近记录: |