Jan 04 2009

ssh remote port forwarding

Category: 技术ssmax @ 22:19:31

     -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 allocat-
             ing 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 by enclosing the address in square braces or using an alternative syntax:
             [bind_address/]host/port/hostport.

             By default, the listening socket on the server will be bound to the loopback interface only.  This may be overriden by specifying a bind_address.
             An empty bind_address, or the address ‘*’, indicates that the remote socket should listen on all interfaces.  Specifying a remote bind_address will
             only succeed if the server’s GatewayPorts option is enabled (see sshd_config(5)).

 

上面是man ssh的说明,其实就是一个通道

client> ssh user@proxy.org 54321:localhost:54321

这样子发到 proxy.org 的54321 端口的请求 就会通过通道发送到 client机的54321端口,完成端口转发,但是要注意几个方面

proxy.org  上面的sshd设置,必须打开 GatewayPorts yes,否则proxy.org 只会监听 127.0.0.1 的 54321端口,也就是设备lo的端口。

另外一个就是在windows下面用客户端连接proxy.org ,也能实现remote port forwarding,但是我在securecrt新旧版本上面死活没有试验成功,全部都没有转发过来,但是在putty上面一下子就ok了,不知道是不是securtcrt的问题,懒得再去研究了,嘿嘿。

做这个东西为了就是突破公司的限制,看看能不能加快点bt或者ed的速度,明天继续试验。


Jan 02 2009

在澳门过的元旦

Category: 乱up当秘笈ssmax @ 23:27:46

今晚终于从澳门回来了,来了公司以后第一次所谓的旅行,自己定行程。。。然后公司报销。。。去澳门3天2晚,这么个小地方,基本都逛完了,澳门市区、氹仔、路环。。。。无聊到极点就跑到黑沙滩去了,那里的烧烤还不错。。。威尼斯人真是tmd贵族专区,里面卖的都是限量版东东。。。新年的烟花给我录下来了,柯达的录像功能看到很不错,哈哈哈


« Previous Page