<?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>梁剑的Blog &#187; 代理</title>
	<atom:link href="http://icomes.net/tag/%e4%bb%a3%e7%90%86/feed/" rel="self" type="application/rss+xml" />
	<link>http://icomes.net</link>
	<description>做有趣的事，做有用的人</description>
	<lastBuildDate>Sat, 05 Nov 2011 18:23:06 +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 tunnel建立本地sock代理</title>
		<link>http://icomes.net/2009/07/25/%e5%88%a9%e7%94%a8ssh-tunnel%e5%bb%ba%e7%ab%8b%e6%9c%ac%e5%9c%b0sock%e4%bb%a3%e7%90%86/</link>
		<comments>http://icomes.net/2009/07/25/%e5%88%a9%e7%94%a8ssh-tunnel%e5%bb%ba%e7%ab%8b%e6%9c%ac%e5%9c%b0sock%e4%bb%a3%e7%90%86/#comments</comments>
		<pubDate>Sat, 25 Jul 2009 06:59:48 +0000</pubDate>
		<dc:creator>梁剑</dc:creator>
				<category><![CDATA[技术笔记]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tunnel]]></category>
		<category><![CDATA[代理]]></category>

		<guid isPermaLink="false">http://icomes.net/?p=415</guid>
		<description><![CDATA[每个人用Proxy的动机可能都不同，当然在这个最大的局域网内，最多应该是为了翻墙吧。 我的目的比较简单，希望有个固定IP可以访问家里的路由器，仅此而已。 需要的资源包括： 一个远程机器的ssh帐号。这个就各显神通了，实在没办法，推荐用unix-center。 装有FoxyProxy的Firefox。这是属于锦上添花的功能，方便切换。不过如果你一定要用IE，我也不会阻拦。 过程： 1. 执行ssh -Nf username@remoteserver.com -D 7070 这个命令会先和remoteserver.com建立一个ssh链接，然后打开本地的7070端口，以后所有对localhost:7070的访问都会转发到remoteserver.com。 前提当然是你在remoteserver.com上拥有username这个帐号。 -N 不执行远程命令 -f 后台执行ssh -D 动态绑定的意思 如果是在Windows下，可以用putty来建立ssh链接。 2. 配置FoxyProxy 不说废话了，贴图吧。如果习惯Tor的话，应该很简单。 3. 建立ssh的信任关系 这是为像我这样懒到不想每次都输密码的人准备的。 在本地执行ssh-keygen -t rsa，一路回车，会在本地生成一对公钥和私钥（通常在~/.ssh下） 将公钥copy到远程机器上的~/.ssh/authorized_keys里，scp或者复制/粘帖，随自己喜欢吧。 然后，就结束了。<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="用visio画的UML图例" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ficomes.net%2F2009%2F10%2F18%2F%25E7%2594%25A8visio%25E7%2594%25BB%25E7%259A%2584uml%25E5%259B%25BE%25E4%25BE%258B%2F&from=http%3A%2F%2Ficomes.net%2F2009%2F07%2F25%2F%25E5%2588%25A9%25E7%2594%25A8ssh-tunnel%25E5%25BB%25BA%25E7%25AB%258B%25E6%259C%25AC%25E5%259C%25B0sock%25E4%25BB%25A3%25E7%2590%2586%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/29/15015128.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">用visio画的UML图例</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="什么是Nginx" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ficomes.net%2F2011%2F02%2F24%2F%25E4%25BB%2580%25E4%25B9%2588%25E6%2598%25AFnginx%2F&from=http%3A%2F%2Ficomes.net%2F2009%2F07%2F25%2F%25E5%2588%25A9%25E7%2594%25A8ssh-tunnel%25E5%25BB%25BA%25E7%25AB%258B%25E6%259C%25AC%25E5%259C%25B0sock%25E4%25BB%25A3%25E7%2590%2586%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/29/15014208.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">什么是Nginx</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Ubuntu 8.04 Server在VMWare中无法启动的解决办法" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ficomes.net%2F2008%2F06%2F29%2Fubuntu-804-server%25E5%259C%25A8vmware%25E4%25B8%25AD%25E6%2597%25A0%25E6%25B3%2595%25E5%2590%25AF%25E5%258A%25A8%25E7%259A%2584%25E8%25A7%25A3%25E5%2586%25B3%25E5%258A%259E%25E6%25B3%2595%2F&from=http%3A%2F%2Ficomes.net%2F2009%2F07%2F25%2F%25E5%2588%25A9%25E7%2594%25A8ssh-tunnel%25E5%25BB%25BA%25E7%25AB%258B%25E6%259C%25AC%25E5%259C%25B0sock%25E4%25BB%25A3%25E7%2590%2586%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/29/15017346.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Ubuntu 8.04 Server在VMWare中无法启动的解决办法</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="浏览器战争" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ficomes.net%2F2009%2F01%2F13%2F%25E6%25B5%258F%25E8%25A7%2588%25E5%2599%25A8%25E6%2588%2598%25E4%25BA%2589%2F&from=http%3A%2F%2Ficomes.net%2F2009%2F07%2F25%2F%25E5%2588%25A9%25E7%2594%25A8ssh-tunnel%25E5%25BB%25BA%25E7%25AB%258B%25E6%259C%25AC%25E5%259C%25B0sock%25E4%25BB%25A3%25E7%2590%2586%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/29/15015466.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">浏览器战争</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></description>
			<content:encoded><![CDATA[<p>每个人用Proxy的动机可能都不同，当然在这个最大的局域网内，最多应该是为了翻墙吧。<br />
我的目的比较简单，希望有个固定IP可以访问家里的路由器，仅此而已。</p>
<p>需要的资源包括：<br />
一个远程机器的ssh帐号。这个就各显神通了，实在没办法，推荐用unix-center。<br />
装有FoxyProxy的Firefox。这是属于锦上添花的功能，方便切换。不过如果你一定要用IE，我也不会阻拦。</p>
<p>过程：<br />
1. 执行<em>ssh -Nf username@remoteserver.com -D 7070</em><br />
这个命令会先和remoteserver.com建立一个ssh链接，然后打开本地的7070端口，以后所有对localhost:7070的访问都会转发到remoteserver.com。<br />
前提当然是你在remoteserver.com上拥有username这个帐号。<br />
-N 不执行远程命令<br />
-f 后台执行ssh<br />
-D 动态绑定的意思<br />
如果是在Windows下，可以用putty来建立ssh链接。</p>
<p>2. 配置FoxyProxy<br />
不说废话了，贴图吧。如果习惯Tor的话，应该很简单。<br />
<a href="http://icomes.net/wp-content/uploads/2009/07/FoxyProxy.png"><img class="alignnone size-medium wp-image-416" title="FoxyProxy" src="http://icomes.net/wp-content/uploads/2009/07/FoxyProxy-300x200.png" alt="FoxyProxy" width="300" height="200" /></a></p>
<p>3. 建立ssh的信任关系<br />
这是为像我这样懒到不想每次都输密码的人准备的。<br />
在本地执行ssh-keygen -t rsa，一路回车，会在本地生成一对公钥和私钥（通常在~/.ssh下）<br />
将公钥copy到远程机器上的~/.ssh/authorized_keys里，scp或者复制/粘帖，随自己喜欢吧。<br />
然后，就结束了。</p>
<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="新主题iBlog2" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ficomes.net%2F2009%2F09%2F15%2F%25E6%2596%25B0%25E4%25B8%25BB%25E9%25A2%2598iblog2%2F&from=http%3A%2F%2Ficomes.net%2F2009%2F07%2F25%2F%25E5%2588%25A9%25E7%2594%25A8ssh-tunnel%25E5%25BB%25BA%25E7%25AB%258B%25E6%259C%25AC%25E5%259C%25B0sock%25E4%25BB%25A3%25E7%2590%2586%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/29/15014886.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">新主题iBlog2</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="什么是Nginx" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ficomes.net%2F2011%2F02%2F24%2F%25E4%25BB%2580%25E4%25B9%2588%25E6%2598%25AFnginx%2F&from=http%3A%2F%2Ficomes.net%2F2009%2F07%2F25%2F%25E5%2588%25A9%25E7%2594%25A8ssh-tunnel%25E5%25BB%25BA%25E7%25AB%258B%25E6%259C%25AC%25E5%259C%25B0sock%25E4%25BB%25A3%25E7%2590%2586%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/29/15014208.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">什么是Nginx</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="Second Screenshot" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ficomes.net%2F2009%2F09%2F03%2Fsecond-screensho%2F&from=http%3A%2F%2Ficomes.net%2F2009%2F07%2F25%2F%25E5%2588%25A9%25E7%2594%25A8ssh-tunnel%25E5%25BB%25BA%25E7%25AB%258B%25E6%259C%25AC%25E5%259C%25B0sock%25E4%25BB%25A3%25E7%2590%2586%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/06/29/15015227.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">Second Screenshot</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="The Last Lecture" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Ficomes.net%2F2011%2F10%2F15%2Fthe-last-lecture%2F&from=http%3A%2F%2Ficomes.net%2F2009%2F07%2F25%2F%25E5%2588%25A9%25E7%2594%25A8ssh-tunnel%25E5%25BB%25BA%25E7%25AB%258B%25E6%259C%25AC%25E5%259C%25B0sock%25E4%25BB%25A3%25E7%2590%2586%2F">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="http://static.wumii.com/site_images/2011/10/15/9228539.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">The Last Lecture</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table>]]></content:encoded>
			<wfw:commentRss>http://icomes.net/2009/07/25/%e5%88%a9%e7%94%a8ssh-tunnel%e5%bb%ba%e7%ab%8b%e6%9c%ac%e5%9c%b0sock%e4%bb%a3%e7%90%86/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

