{"id":921,"date":"2014-06-23T15:30:09","date_gmt":"2014-06-23T07:30:09","guid":{"rendered":"http:\/\/www.zhangling.org\/blog\/?p=921"},"modified":"2014-06-23T19:05:06","modified_gmt":"2014-06-23T11:05:06","slug":"ssh-tunnel-proxy","status":"publish","type":"post","link":"https:\/\/www.zhangling.org\/blog\/20140623\/ssh-tunnel-proxy.html","title":{"rendered":"\u5229\u7528SSH Tunnel\u5b9e\u73b0\u4e00\u952e\u7ffb\u5899"},"content":{"rendered":"<p>\u9996\u5148\uff0c\u2019\u4e00\u952e\u7ffb\u5899\u2018\u5e76\u4e0d\u662f\u771f\u6b63\u7684\u2019\u4e00\u952e\u2018\uff0c\u5728Firefox\u7528\u6b64\u65b9\u6cd5\u81f3\u5c11\u9700\u8981\u4e09\u952e\uff0c\u800c\u4e14\u8fd9\u4e2a\u65b9\u6cd5\u7684\u95e8\u69db\u4e0d\u4f4e\uff0c\u4e0d\u4ec5\u9700\u8981\u4e00\u4e2a\u53ef\u4ee5\u63d0\u4f9bSSH\u8bbf\u95ee\u7684\u4e2d\u7ee7\u670d\u52a1\u5668\uff0c\u5ba2\u6237\u7aef\u7684\u8bbe\u7f6e\u4e5f\u6bd4\u8f83\u9ebb\u70e6\uff0c\u6240\u4ee5\u672c\u65b9\u6cd5\u4e0d\u9002\u7528\u975eIT\u4eba\u58eb\u3002<\/p>\n<p>\u6b65\u9aa4\uff1a<\/p>\n<p>1. \u9996\u5148\u4f60\u9700\u8981\u4e00\u4e2a\u63d0\u4f9bSSH\u7684\u4e2d\u7ee7\u670d\u52a1\u5668\uff0c\u8fd9\u91cc\u4ee5dreamhost.com\u4e3a\u4f8b\u3002\u5982\u679c\u8d2d\u4e70\u8fc7dreamhost\u7684\u865a\u62df\u4e3b\u673a\u670d\u52a1\u7684\u7528\u6237\uff0c\u5728<a href=\"https:\/\/panel.dreamhost.com\/\">https:\/\/panel.dreamhost.com<\/a> \u4e0a\u521b\u5efa\u53ef\u4ee5\u4f7f\u7528\u8bbf\u95eeSSH\u7684\u7528\u6237\u8d26\u6237\uff0c\u5229\u7528\u8be5\u8d26\u6237\u53ef\u4ee5SSH\u5230\u670d\u52a1\u5668:<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.zhangling.org\/blog\/images\/uploads\/2014\/06\/dreamhost.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-923\" title=\"dreamhost\" src=\"https:\/\/www.zhangling.org\/blog\/images\/uploads\/2014\/06\/dreamhost.png\" alt=\"\" width=\"640\" height=\"300\" \/><\/a><\/p>\n<p>2. \u7528Putty(\u4e00\u4e2aWindows \u4e0a\u7684SSH\u5ba2\u6237\u7aef\u8f6f\u4ef6)\u521b\u5efa\u4e00\u4e2aSSH Tunnel\uff0c\u4ee5\u5728\u5ba2\u6237\u7aef\u521b\u5efa\u4e00\u4e2a\u53ef\u4f9b\u6d4f\u89c8\u5668\u4f7f\u7528\u7684\u4ee3\u7406\u670d\u52a1\u5668\u3002\u9996\u5148\uff0c\u8f93\u5165dreamhost\u7684\u4e3b\u673a\u540d\u3001\u7aef\u53e3\u53f7\uff0c\u7136\u540e\u5230Connections -&gt; SSH -&gt; Tunnels\u7a97\u53e3\uff0c\u9009\u62e9\u2019Dynamic&#8217;\uff0c\u7136\u540e\u8f93\u5165\u4e00\u4e2a\u672c\u673a\u7aef\u53e3\u53f7\uff0c\u59829999\uff0c\u7136\u540e\u70b9&#8217;Add&#8217;\uff0c\u5b8c\u6210\u540e\u628a\u8be5\u914d\u7f6e\u5728Putty\u5185\u4fdd\u5b58\u6210\u4e00\u4e2a\u2018Saved Session\u2019\uff1a \u6ce8\u610f\u4fdd\u5b58\u540e\u7684\u914d\u7f6e\u540d\u5728\u4e4b\u540e\u7684\u914d\u7f6e\u4e2d\u4f1a\u4f7f\u7528\u5230\u3002<\/p>\n<p style=\"text-align: center;\"><a href=\"https:\/\/www.zhangling.org\/blog\/images\/uploads\/2014\/06\/putty.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-924\" title=\"putty\" src=\"https:\/\/www.zhangling.org\/blog\/images\/uploads\/2014\/06\/putty.png\" alt=\"\" width=\"640\" height=\"300\" \/><\/a><\/p>\n<p>3. \u5b89\u88c5\u4e24\u4e2aFirefox\u63d2\u4ef6\u3002<\/p>\n<p><strong>\u63d2\u4ef61<\/strong>\uff1a Proxy Selector &#8211; <a href=\"https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/proxy-selector\/\">https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/proxy-selector\/<\/a>\u3002\u8fd9\u4e2a\u63d2\u4ef6\u5141\u8bb8\u5728Firefox\u4e0a\u914d\u7f6e\u591a\u4e2a\u5907\u9009proxy\uff0c\u5e76\u5feb\u901f\u5207\u6362\u3002\u8fd9\u91cc\u6211\u4eec\u914d\u7f6e\u4e00\u4e2a\u672c\u5730localhost\u7684\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u5176\u7aef\u53e3\u53f7\u4e3a\u4e0a\u6b65\u5728putty\u7684Tunnels\u4e2d\u914d\u7f6e\u76849999\u7aef\u53e3\u3002\u6ce8\u610f\u9700\u8981\u628a\u4ee3\u7406\u7c7b\u578b\u8bbe\u7f6e\u4e3a\u2018Socket 4\u2019\u3002<\/p>\n<p style=\"text-align: left;\"><a href=\"https:\/\/www.zhangling.org\/blog\/images\/uploads\/2014\/06\/proxy_config.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-926\" title=\"proxy_config\" src=\"https:\/\/www.zhangling.org\/blog\/images\/uploads\/2014\/06\/proxy_config.png\" alt=\"\" width=\"500\" height=\"420\" \/><\/a><strong><\/strong><\/p>\n<p style=\"text-align: left;\"><strong>\u63d2\u4ef62<\/strong>\uff1aExternal application Button &#8211; <a href=\"https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/external-application-button\">https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/external-application-button<\/a>\/ \u8fd9\u4e2a\u63d2\u4ef6\u7684\u4f5c\u7528\u662f\u5728Firefox\u4e0a\u521b\u5efa\u8fd0\u884c\u672c\u5730\u5e94\u7528\u7a0b\u5e8f\u7684\u5feb\u6377\u65b9\u5f0f\uff0c\u7528\u6765\u5feb\u901f\u542f\u52a8putty\u547d\u4ee4\u884c\u65b9\u5f0f\uff08\u53ef\u9884\u5148\u914d\u7f6e\u597d\u7528\u6237\u540d\u548c\u5bc6\u7801\uff09\u3002<\/p>\n<p style=\"text-align: left;\"><a href=\"https:\/\/www.zhangling.org\/blog\/images\/uploads\/2014\/06\/extapp_config.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-928\" title=\"extapp_config\" src=\"https:\/\/www.zhangling.org\/blog\/images\/uploads\/2014\/06\/extapp_config.png\" alt=\"\" width=\"600\" height=\"400\" \/><\/a><\/p>\n<p style=\"text-align: left;\">\u8fd9\u91cc\u6211\u4eec\u5efa\u7acb\u4e86\u4e00\u4e2a\u5feb\u6377\u65b9\u5f0f\uff0c\u6307\u5411\u4e86\u4e00\u4e2abat\u6587\u4ef6<em><strong>startPuttySilent.bat<\/strong><\/em>\u3002\u6b64bat\u6587\u4ef6\u5185\u5bb9\u5982\u4e0b\uff1a<\/p>\n<p><em>start &#8220;&#8221; c:\\app\\putty.exe -load &#8220;tournemire.dreamhost.com&#8221; -l &lt;USERNAME&gt; -pw &lt;PASSWORD&gt;<\/em><\/p>\n<p>\u6ce8\u610f\u8fd9\u91cc\u5e26\u4e86\u53cc\u5f15\u53f7\u7684tournemire.dreamhost.com\u5e76\u4e0d\u4ee3\u8868\u4e00\u4e2a\u670d\u52a1\u5668\uff0c\u800c\u662f\u4f60\u5728\u6b65\u9aa42\u4e2d\u5728Putty\u4e0a\u5b9a\u4e49\u7684\u2018Saved Session\u2019\u540d\u5b57\uff0c\u4f60\u53ef\u4ee5\u53d6\u5982 &#8216;My proxy server\u2019\u8fd9\u6837\u7684\u540d\u5b57\uff0c\u5b83\u5b9e\u9645\u6307\u5411\u4e86putty\u4e2d\u8be5\u914d\u7f6e\u4e2d\u5b9a\u4e49\u7684SSH\u670d\u52a1\u5668\u5730\u5740\u3002<\/p>\n<p>-l\u548c-pw\u5206\u522b\u4e3a\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u5982\u679c\u62c5\u5fc3\u5b89\u5168\u95ee\u9898\uff0c\u53ef\u4ee5\u4e0d\u6307\u5b9a\uff0c\u800c\u662f\u5728\u6bcf\u6b21\u542f\u52a8SSH\u8fde\u63a5\u7684\u65f6\u5019\u624b\u5de5\u8f93\u5165\u3002\u547d\u4ee4\u884c\u524d\u4f7f\u7528\u4e86\u2018start&#8230;\u2019 \u7684\u76ee\u7684\u5728\u4e8e\u542f\u52a8\u540e\u53ea\u4fdd\u7559putty\u7684\u547d\u4ee4\u884c\u7a97\u6237\uff0c\u800c\u539f\u59cb\u7684Windows\u547d\u4ee4\u884c\u7a97\u53e3\u5173\u95ed\uff0c\u5426\u5219\u4f1a\u663e\u793a\u4e24\u4e2a\u9ed1\u7a97\u53e3\u3002<\/p>\n<p>\u73b0\u5728\u9700\u8981\u7684\u914d\u7f6e\u90fd\u5b8c\u6210\u4e86\uff0c\u5f53\u4f60\u9700\u8981\u542f\u52a8\u4ee3\u7406\u7ffb\u5899\u7684\u65f6\u5019\u53ea\u9700\u8981\uff1a<\/p>\n<p><strong>1. \u5728Firefox\u4e2dProxy Selector\u63d2\u4ef6\u9009\u9879\u5b9a\u4e49\u597d\u7684\u672c\u5730\u4ee3\u7406(2\u952e)\uff1b2) \u5728Firefox\u70b9\u51fb\u5b9a\u4e49\u597d\u7684\u5916\u90e8putty\u5e94\u7528\u5feb\u6377\u65b9\u5f0f (1\u952e) &#8211; \u6700\u5feb3\u952e\u53ef\u4ee5\u5b8c\u6210\u4ee3\u7406\u5207\u6362\u3002<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u9996\u5148\uff0c\u2019\u4e00\u952e\u7ffb\u5899\u2018\u5e76\u4e0d\u662f\u771f\u6b63\u7684\u2019\u4e00\u952e\u2018\uff0c\u5728Firefox\u7528\u6b64\u65b9\u6cd5\u81f3\u5c11\u9700\u8981\u4e09\u952e\uff0c\u800c\u4e14\u8fd9\u4e2a\u65b9\u6cd5\u7684\u95e8\u69db\u4e0d\u4f4e\uff0c\u4e0d\u4ec5\u9700\u8981\u4e00\u4e2a\u53ef\u4ee5\u63d0\u4f9bSSH\u8bbf\u95ee\u7684\u4e2d\u7ee7\u670d\u52a1\u5668\uff0c\u5ba2\u6237\u7aef\u7684\u8bbe\u7f6e\u4e5f\u6bd4\u8f83\u9ebb\u70e6\uff0c\u6240\u4ee5\u672c\u65b9\u6cd5\u4e0d\u9002\u7528\u975eIT\u4eba\u58eb\u3002 \u6b65\u9aa4\uff1a 1. \u9996\u5148\u4f60\u9700\u8981\u4e00\u4e2a\u63d0\u4f9bSSH\u7684\u4e2d\u7ee7\u670d\u52a1\u5668\uff0c\u8fd9\u91cc\u4ee5dreamhost.com\u4e3a\u4f8b\u3002\u5982\u679c\u8d2d\u4e70\u8fc7dreamhost\u7684\u865a\u62df\u4e3b\u673a\u670d\u52a1\u7684\u7528\u6237\uff0c\u5728https:\/\/panel.dreamhost.com \u4e0a\u521b\u5efa\u53ef\u4ee5\u4f7f\u7528\u8bbf\u95eeSSH\u7684\u7528\u6237\u8d26\u6237\uff0c\u5229\u7528\u8be5\u8d26\u6237\u53ef\u4ee5SSH\u5230\u670d\u52a1\u5668: 2. \u7528Putty(\u4e00\u4e2aWindows \u4e0a\u7684SSH\u5ba2\u6237\u7aef\u8f6f\u4ef6)\u521b\u5efa\u4e00\u4e2aSSH Tunnel\uff0c\u4ee5\u5728\u5ba2\u6237\u7aef\u521b\u5efa\u4e00\u4e2a\u53ef\u4f9b\u6d4f\u89c8\u5668\u4f7f\u7528\u7684\u4ee3\u7406\u670d\u52a1\u5668\u3002\u9996\u5148\uff0c\u8f93\u5165dreamhost\u7684\u4e3b\u673a\u540d\u3001\u7aef\u53e3\u53f7\uff0c\u7136\u540e\u5230Connections -&gt; SSH -&gt; Tunnels\u7a97\u53e3\uff0c\u9009\u62e9\u2019Dynamic&#8217;\uff0c\u7136\u540e\u8f93\u5165\u4e00\u4e2a\u672c\u673a\u7aef\u53e3\u53f7\uff0c\u59829999\uff0c\u7136\u540e\u70b9&#8217;Add&#8217;\uff0c\u5b8c\u6210\u540e\u628a\u8be5\u914d\u7f6e\u5728Putty\u5185\u4fdd\u5b58\u6210\u4e00\u4e2a\u2018Saved Session\u2019\uff1a \u6ce8\u610f\u4fdd\u5b58\u540e\u7684\u914d\u7f6e\u540d\u5728\u4e4b\u540e\u7684\u914d\u7f6e\u4e2d\u4f1a\u4f7f\u7528\u5230\u3002 3. \u5b89\u88c5\u4e24\u4e2aFirefox\u63d2\u4ef6\u3002 \u63d2\u4ef61\uff1a Proxy Selector &#8211; https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/proxy-selector\/\u3002\u8fd9\u4e2a\u63d2\u4ef6\u5141\u8bb8\u5728Firefox\u4e0a\u914d\u7f6e\u591a\u4e2a\u5907\u9009proxy\uff0c\u5e76\u5feb\u901f\u5207\u6362\u3002\u8fd9\u91cc\u6211\u4eec\u914d\u7f6e\u4e00\u4e2a\u672c\u5730localhost\u7684\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u5176\u7aef\u53e3\u53f7\u4e3a\u4e0a\u6b65\u5728putty\u7684Tunnels\u4e2d\u914d\u7f6e\u76849999\u7aef\u53e3\u3002\u6ce8\u610f\u9700\u8981\u628a\u4ee3\u7406\u7c7b\u578b\u8bbe\u7f6e\u4e3a\u2018Socket 4\u2019\u3002 \u63d2\u4ef62\uff1aExternal application Button &#8211; https:\/\/addons.mozilla.org\/en-US\/firefox\/addon\/external-application-button\/ \u8fd9\u4e2a\u63d2\u4ef6\u7684\u4f5c\u7528\u662f\u5728Firefox\u4e0a\u521b\u5efa\u8fd0\u884c\u672c\u5730\u5e94\u7528\u7a0b\u5e8f\u7684\u5feb\u6377\u65b9\u5f0f\uff0c\u7528\u6765\u5feb\u901f\u542f\u52a8putty\u547d\u4ee4\u884c\u65b9\u5f0f\uff08\u53ef\u9884\u5148\u914d\u7f6e\u597d\u7528\u6237\u540d\u548c\u5bc6\u7801\uff09\u3002 \u8fd9\u91cc\u6211\u4eec\u5efa\u7acb\u4e86\u4e00\u4e2a\u5feb\u6377\u65b9\u5f0f\uff0c\u6307\u5411\u4e86\u4e00\u4e2abat\u6587\u4ef6startPuttySilent.bat\u3002\u6b64bat\u6587\u4ef6\u5185\u5bb9\u5982\u4e0b\uff1a start &#8220;&#8221; c:\\app\\putty.exe -load &#8220;tournemire.dreamhost.com&#8221; -l &lt;USERNAME&gt; -pw &lt;PASSWORD&gt; \u6ce8\u610f\u8fd9\u91cc\u5e26\u4e86\u53cc\u5f15\u53f7\u7684tournemire.dreamhost.com\u5e76\u4e0d\u4ee3\u8868\u4e00\u4e2a\u670d\u52a1\u5668\uff0c\u800c\u662f\u4f60\u5728\u6b65\u9aa42\u4e2d\u5728Putty\u4e0a\u5b9a\u4e49\u7684\u2018Saved Session\u2019\u540d\u5b57\uff0c\u4f60\u53ef\u4ee5\u53d6\u5982 &#8216;My proxy server\u2019\u8fd9\u6837\u7684\u540d\u5b57\uff0c\u5b83\u5b9e\u9645\u6307\u5411\u4e86putty\u4e2d\u8be5\u914d\u7f6e\u4e2d\u5b9a\u4e49\u7684SSH\u670d\u52a1\u5668\u5730\u5740\u3002 -l\u548c-pw\u5206\u522b\u4e3a\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u5982\u679c\u62c5\u5fc3\u5b89\u5168\u95ee\u9898\uff0c\u53ef\u4ee5\u4e0d\u6307\u5b9a\uff0c\u800c\u662f\u5728\u6bcf\u6b21\u542f\u52a8SSH\u8fde\u63a5\u7684\u65f6\u5019\u624b\u5de5\u8f93\u5165\u3002\u547d\u4ee4\u884c\u524d\u4f7f\u7528\u4e86\u2018start&#8230;\u2019 \u7684\u76ee\u7684\u5728\u4e8e\u542f\u52a8\u540e\u53ea\u4fdd\u7559putty\u7684\u547d\u4ee4\u884c\u7a97\u6237\uff0c\u800c\u539f\u59cb\u7684Windows\u547d\u4ee4\u884c\u7a97\u53e3\u5173\u95ed\uff0c\u5426\u5219\u4f1a\u663e\u793a\u4e24\u4e2a\u9ed1\u7a97\u53e3\u3002 \u73b0\u5728\u9700\u8981\u7684\u914d\u7f6e\u90fd\u5b8c\u6210\u4e86\uff0c\u5f53\u4f60\u9700\u8981\u542f\u52a8\u4ee3\u7406\u7ffb\u5899\u7684\u65f6\u5019\u53ea\u9700\u8981\uff1a 1. \u5728Firefox\u4e2dProxy Selector\u63d2\u4ef6\u9009\u9879\u5b9a\u4e49\u597d\u7684\u672c\u5730\u4ee3\u7406(2\u952e)\uff1b2) \u5728Firefox\u70b9\u51fb\u5b9a\u4e49\u597d\u7684\u5916\u90e8putty\u5e94\u7528\u5feb\u6377\u65b9\u5f0f (1\u952e) &#8211; \u6700\u5feb3\u952e\u53ef\u4ee5\u5b8c\u6210\u4ee3\u7406\u5207\u6362\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[10],"class_list":["post-921","post","type-post","status-publish","format-standard","hentry","category-tech","tag-ssh-tunnel-proxy-gfw"],"_links":{"self":[{"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/posts\/921","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/comments?post=921"}],"version-history":[{"count":14,"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/posts\/921\/revisions"}],"predecessor-version":[{"id":932,"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/posts\/921\/revisions\/932"}],"wp:attachment":[{"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/media?parent=921"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/categories?post=921"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zhangling.org\/blog\/wp-json\/wp\/v2\/tags?post=921"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}