|
发表于 2005-8-29 22:37:37
|
显示全部楼层
ssh 的反向转发是很有趣。
外网主机无法直接连接内网的机子,这时候内网机子就可以用ssh建立到外网主机上ssh服务的反向连接,将ssh连接转发到外网的某个本地端口上,这样外网主机就可以通过连接本地端口来变相的连接到内网主机上。
我没有实际使用过,只是从debian的邮件列表上看到过这样的讨论。
我想ssh连接中断可能是跟外网主机的ssh服务配置有关,改一下相应的配置文件是否更方便?
ssh
-R port:host:hostport
Specifies that the given port on the remote (server) host is to be forwarded to
the given host and port on the local side. This works by allocating a socket
to listen to port on the remote side, and whenever a connection is made to this
port, the connection is forwarded over the secure channel, and a connection is
made to host port hostport from the local machine. Port forwardings can also
be specified in the configuration file. Privileged ports can be forwarded only
when logging in as root on the remote machine. IPv6 addresses can be specified
with an alternative syntax: port/host/hostport. |
|