一,应用(亲测)(仅仅使用不用看第二步):
ssh -CfNg -L 8103:186.186.186.88:8101 root@186.186.186.88
ssh -CfNg -L 8104:186.186.186.88:8102 root@186.186.186.88
目的是访问B的8102和8101,外部设备首先访问A
从A的端口8103 访问 ---->B的端口8101,在A上执行即可。两个ip都是B的(不完全是),如果急着使用,直接执行上句就可,
然后查看 netstat -nlp |grep 8103
二、why + learn more
我也不懂,推荐看:(两个 url 是不一样的)
http://blog.sina.com.cn/s/blog_72ec04780100ugjk.html
http://blog.sina.com.cn/s/blog_72ec04780100ugiz.html