是否可以设置具有动态端口转发的SSH隧道,如下所示:
ssh -D
但是反过来做呢?这就是说,我想在我的本地机器上发起连接,并在那里进行动态端口转发,然后让我的朋友将他的浏览器连接到隧道的另一端。
如果我的朋友输入了上面的内容,上面的代码就能完美地工作,但我不想让他通过ssh访问我的机器,只要让他代理他的浏览器即可。
发布于 2009-05-08 22:13:48
对于openssh,请参见-R开关:
-R [bind_address:]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 connec‐
tion is forwarded over the secure channel, and a connection is
made to host port hostport from the local machine.尽管可能有更好的解决方案,但您可以按以下方式在朋友的计算机remotehost端口24680处创建SOCKS代理。首先,做
ssh -R 24680:localhost:12345 remotehost然后,做
ssh -D 12345 localhost显然,这两个会话需要同时保持活动状态。
https://stackoverflow.com/questions/842021
复制相似问题