<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>wd and cc &#187; proxy</title>
	<atom:link href="http://wdicc.com/tag/proxy/feed/" rel="self" type="application/rss+xml" />
	<link>http://wdicc.com</link>
	<description>Happy every day...</description>
	<lastBuildDate>Wed, 01 Feb 2012 03:27:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>ssh 之穿越与反穿越</title>
		<link>http://wdicc.com/ssh-proxy/</link>
		<comments>http://wdicc.com/ssh-proxy/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 07:09:45 +0000</pubDate>
		<dc:creator>wd</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://wdicc.com/ssh-proxy/</guid>
		<description><![CDATA[有时候我们不得不和网管对着干，去想办法去穿越某些防火墙，访问到我们要访问的资源。例如下面的情况，A 和 C 之间是有个墙的，不通。可有个 B 能访问到 C，而 A 又能访问到 B ，那我们可以通过你 ssh 做代理穿越那个墙。 A -&#62; &#124; -&#62; C \-&#62; B -&#62; C 在A 上面执行下面的命令 ssh -f -N -g -L 8888:C_ip:80 B_ip参数的含义：-f 放到后台-N 不在对方机器请求 shell-g 能使得别的机器能连接 A 的那个端口-L 就是代理，具体看 man 这样，在 A 上面访问 8888 端口，就能访问到 C 的 80 端口了。 那如果是下面的网络情况，那怎么办？A 能访问到 C，但是 C 不能直接访问 A。 A [...]]]></description>
			<content:encoded><![CDATA[<p>有时候我们不得不和网管对着干，去想办法去穿越某些防火墙，访问到我们要访问的资源。例如下面的情况，A 和 C 之间是有个墙的，不通。可有个 B 能访问到 C，而 A 又能访问到 B ，那我们可以通过你 ssh 做代理穿越那个墙。</p>
<p>A -&gt; | -&gt; C<br /> \-&gt; B -&gt; C</p>
<p>在A 上面执行下面的命令</p>
<p>ssh -f -N -g -L 8888:C_ip:80 B_ip<br />参数的含义：-f 放到后台<br />-N 不在对方机器请求 shell<br />-g 能使得别的机器能连接 A 的那个端口<br />-L 就是代理，具体看 man </p>
<p>这样，在 A 上面访问 8888 端口，就能访问到 C 的 80 端口了。</p>
<p>那如果是下面的网络情况，那怎么办？A 能访问到 C，但是 C 不能直接访问 A。</p>
<p>A -&gt; C<br />C-&gt; | -&gt; A</p>
<p>在 A 上面执行下面的命令</p>
<p>ssh -f -N -R 9999:A_ip:80 C_ip<br />-R 是反向代理, -g 在这里好像不好用不知道为什么</p>
<p>从 C 上面访问自己的 9999 端口，就会访问到 A 的 80 端口。</p>
]]></content:encoded>
			<wfw:commentRss>http://wdicc.com/ssh-proxy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

