赞
踩
HostA利用ssh tunnel,通过HostB,将HostB或HostC的服务,监听在HostA本地
适用于:HostA只能连墙内,HostB的ssh服务的情况
Specifies that connections to the given TCP port or Unix socket on the
local (client) host are to be forwarded to the given host and port,
or Unix socket, on the remote side
将远程主机端口或socket,转发并监听到本地
在HostA上运行:
暴露HostB端口到HostA
ssh -CNL HostA:portA:HostB:portB Buser@HostB -p 22
暴露HostC端口到HostA
ssh -CNL HostA:portA:HostC:portC user@HostB -p 22
HostB利用ssh tunnel将本地或者HostC的端口监听在HostA
适用于:HostA无法直接访问内部,只有HostB可以访问外部的情况
Specifies that connections to the given TCP port or Unix socket on the
remote (server) host are to be forwarded to the given host and port
or Unix socket, on the local side.
将本端端口或者socket,转发并监听在远程主机
在HostB运行:
暴露HostB端口到HostA
ssh -CNR portA:HostB:portB UserA@HostA -p 22
暴露HostC端口到HostA
ssh -CNR portA:HostC:portC UserA@HostA -p 22
HostB或HostC,通过HostB与HostA的ssh tunnel代理上网
适用于:HostA可以上网,HostB和HostC不能上网
在HostB上运行:
ssh -CND HostB:portB UserA@HostA -p 22
在HostC上可通过socket上网
curl --socks5 HostB:portB www.baidu.com
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。