Submitted by dravenk on Wed, 08/08/2018 - 16:06
所需条件:

  • 一台具有公网地址的服务器
  • 一台局域网内的电脑

在内网的电脑上执行:

ssh -qTfNn -R '[::]:8787:localhost:8887' User@RemoteHost

解释:访问远程服务器(RemoteHost)的 8787 端口,会将访问转发到内网电脑的 8887 端口。

还需要

vim /etc/ssh/sshd_config

加上

GatewayPorts yes

最后修改:2023 年 08 月 04 日
如果觉得我的文章对你有用,请随意赞赏