设置端口转发,本机端口11112能打开远端 66.66.66.66:443 的图形化界面
ssh -X -L 11112:66.66.66.66:443 user@10.136.77.88
说明:
本地端口:11112
远端服务器:66.66.66.66,远端端口:443
SSH服务器:10.136.77.88(作为跳板机)
然后本地可以通过https://127.0.0.1:11112 或者https://localhost:11112
注意:因为远端端口是443,所以要用https
附:相关常用选项参数
-L: 本地端口转发
-R: 远程端口转发
-f: 后台运行进程
-N: 不执行登录shell
也可以使用工具配置。
1.XShell
(1) 新建Session
Protocol: SSH
Host: 10.136.77.88
Port Number: 22
(2) 选择 SSH -> Tunneling
Type(Direction): Local(Outgoing)
Source Host: 127.0.0.1
Listening Port: 11112
Destination Host: 66.66.66.66
Destination Port: 443
2.MobaXterm
可以直接在窗口输入命令连接 ssh -X -L 11112:66.66.66.66:443 user@10.136.77.88
也可以在Tunneling中配置,如下
Type: Local
Forward Port: 11112
Destination Server: 66.66.66.66 :443
SSH Server:user@10.136.77.88 :22
然后点击“Start/Stop”按钮中的“Start”即可。
(1)选择Tunneling
(2)选择Local port forwading,配置如下
(3)配置后保存如下