Chinaunix首页 | 论坛 | 博客
  • 博客访问: 581492
  • 博文数量: 158
  • 博客积分: 2696
  • 博客等级: 少校
  • 技术积分: 1668
  • 用 户 组: 普通用户
  • 注册时间: 2007-06-10 00:49
个人简介

life?is?short?,?play?more!

文章分类

全部博文(158)

文章存档

2021年(1)

2013年(10)

2012年(4)

2011年(11)

2010年(27)

2009年(28)

2008年(52)

2007年(25)

我的朋友

分类: LINUX

2010-04-28 21:48:58

ssh

-g Allows remote hosts to connect to local forwarded ports.


-L [bind_address:]port:host:hostport
Specifies that the given port on the local (client) host is to be
forwarded to the given host and port on the remote side. This
works by allocating a socket to listen to port on the local side,
optionally bound to the specified bind_address. Whenever a con-
nection is made to this port, the connection is forwarded over
the secure channel, and a connection is made to host port
hostport from the remote machine. Port forwardings can also be
specified in the configuration file. IPv6 addresses can be spec-
ified with an alternative syntax:
[bind_address/]port/host/hostport or by enclosing the address in
square brackets. Only the superuser can forward privileged
ports. By default, the local port is bound in accordance with
the GatewayPorts setting. However, an explicit bind_address may
be used to bind the connection to a specific address. The
bind_address of ``localhost'' indicates that the listening port
be bound for local use only, while an empty address or '*' indi-
cates that the port should be available from all interfaces.

ssh -gL [bind_address:]port:host:hostport host

这样就可以forward到host上的某个端口上了.
如果退出了该ssh连接,则取消了该"服务"
阅读(737) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~