是否可以设置具有动态端口转发的SSH隧道,如下所示:
ssh -D
但反过来呢?这就是说我想在我的本地机器上启动连接并在那里进行动态端口转发,让我的朋友将他的浏览器连接到隧道的另一端.
如果我的朋友输入上述内容,上面的工作完美,但我不想给他ssh访问我的机器,只是让他代理他的浏览器.
对于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
显然,两个会议都需要同时保持活力.