SecureCRT remote port forwarding/X11 配置方法
2013-08-28 15:52阅读:
缺省情况下,remote-port-forwarding只能将本地(ssh
client端)端口映射到远端(sshd端)的127.0.0.1上,这里介绍允许公网访问的方法。
1,sshd server配置
修改/etc/ssh/sshd_config如下:
AllowTcpForwarding yes
GatewayPorts yes
其他有关的参数使用缺省即可:X11Forwarding,X11DisplayOffset,X11UseLocalhost等
重启sshd:/etc/init.d/sshd restart
2,X server
在管理员机上安装xming或cygwin等Xserver软件,并启动,检查6000端口
3,secureCRT的session配置
设置Port forwarding -> Remote/X11, remote和local都是用6000端口即可,勾选'Forward X11 packets'。
此时以为已完成了,但事实上仍然只能从远端的127.0.0.1访问。从远端(sshd)的 /var/log/secure日志中可以看到类似下面的信息:
sshd[9162]: channel 2: open failed: administratively prohibited: Rejecting remote forward request from a.b.c.d:18826 to 127.0.0.1:6000 because the current filters do not allow a.b.c.d:18826 to use the remote forward.
如果secureCRT开启'Trace Options'开关,能在本地看到类似信息。
下面的步骤非常关键:
使用notepad等工具打开编辑session的ini配置文件。找到 S:'Reverse Forward Filter',该项目缺省仅allow,127.0.0.1,0 deny,0.0.0.0/0.0.0.0,0 。这是被filter的关键原因。
修改该配置项目,重启seureC
1,sshd server配置
修改/etc/ssh/sshd_config如下:
AllowTcpForwarding yes
GatewayPorts yes
其他有关的参数使用缺省即可:X11Forwarding,X11DisplayOffset,X11UseLocalhost等
重启sshd:/etc/init.d/sshd restart
2,X server
在管理员机上安装xming或cygwin等Xserver软件,并启动,检查6000端口
3,secureCRT的session配置
设置Port forwarding -> Remote/X11, remote和local都是用6000端口即可,勾选'Forward X11 packets'。
此时以为已完成了,但事实上仍然只能从远端的127.0.0.1访问。从远端(sshd)的 /var/log/secure日志中可以看到类似下面的信息:
sshd[9162]: channel 2: open failed: administratively prohibited: Rejecting remote forward request from a.b.c.d:18826 to 127.0.0.1:6000 because the current filters do not allow a.b.c.d:18826 to use the remote forward.
如果secureCRT开启'Trace Options'开关,能在本地看到类似信息。
下面的步骤非常关键:
使用notepad等工具打开编辑session的ini配置文件。找到 S:'Reverse Forward Filter',该项目缺省仅allow,127.0.0.1,0 deny,0.0.0.0/0.0.0.0,0 。这是被filter的关键原因。
修改该配置项目,重启seureC
