我设置了从家用计算机到工作服务器的反向SSH隧道:
ssh -f -N -R 19999:localhost:22 remoteuser@server
要连接到我的家用计算机,我必须先登录到服务器,然后从那里登录到我的家用计算机:
otheruser@othermachine$ ssh remoteuser@server
remoteuser@server$ ssh -p 19999 homeuser@localhost
但是我希望能够跳过一步,并直接通过端口19999连接,例如:
otheruser@othermachine$ ssh -p 19999 homeuser@server
我不太熟悉,iptables
我一直在阅读,但是仅仅打开一个端口似乎太混乱了。我很确定我需要向添加一条规则iptables
,但是还有什么需要做的吗?
服务器是RHEL 6,我的家用计算机是Ubuntu 14.04
除了之外iptables
,您还需要将此-g
选项与ssh
(GatewayPorts)一起使用,并且服务器的配置/etc/ssh/sshd_config
必须具有GatewayPorts yes
设置。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句