{"id":810,"date":"2017-08-19T21:01:59","date_gmt":"2017-08-19T13:01:59","guid":{"rendered":"http:\/\/192.168.1.20\/?p=810"},"modified":"2017-10-13T22:07:53","modified_gmt":"2017-10-13T14:07:53","slug":"ubuntu-{d4daabd1ba368d9860c36387ddb72bbda14f8f9559d69d60a952800885260c03}e6{d4daabd1ba368d9860c36387ddb72bbda14f8f9559d69d60a952800885260c03}9c{47dd41ec6bdcbd9a214c783a3735392b82ea6d1d918378c5a53e0640","status":"publish","type":"post","link":"http:\/\/alextop.top\/?p=810","title":{"rendered":"ubuntu \u670d\u52a1\u5668\u642d\u5efa Shadowsocks \u670d\u52a1"},"content":{"rendered":"<h1 id=\"1-shadowsocks-\u670d\u52a1\u5668\u5b89\u88c5\">1. shadowsocks \u670d\u52a1\u5668\u5b89\u88c5<\/h1>\n<p>\u66f4\u65b0\u8f6f\u4ef6\u6e90<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs bash has-numbering\"><span class=\"hljs-built_in\">sudo<\/span> apt-get update<\/code><\/pre>\n<p>\u7136\u540e\u5b89\u88c5 PIP \u73af\u5883<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs lasso has-numbering\">sudo apt<span class=\"hljs-attribute\">-get<\/span> install python<span class=\"hljs-attribute\">-pip<\/span><\/code><\/pre>\n<p>\u76f4\u63a5\u5b89\u88c5 shadowsocks<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs bash has-numbering\"><span class=\"hljs-built_in\">sudo<\/span> pip install shadowsocks<\/code><\/pre>\n<h1 id=\"2-\u8fd0\u884c-shadowsocks-\u670d\u52a1\u5668\"><a target=\"_blank\" name=\"t1\"><\/a>2. \u8fd0\u884c shadowsocks \u670d\u52a1\u5668<\/h1>\n<p>\u542f\u52a8\u547d\u4ee4\u5982\u4e0b\uff1a\u5982\u679c\u8981\u505c\u6b62\u8fd0\u884c\uff0c\u5c06\u547d\u4ee4\u4e2d\u7684start\u6539\u6210stop\u3002<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs lasso has-numbering\">sudo ssserver <span class=\"hljs-attribute\">-p<\/span> <span class=\"hljs-number\">8388<\/span> <span class=\"hljs-attribute\">-k<\/span> password <span class=\"hljs-attribute\">-m<\/span> aes<span class=\"hljs-subst\">-<\/span><span class=\"hljs-number\">256<\/span><span class=\"hljs-attribute\">-cfb<\/span> <span class=\"hljs-attribute\">-d<\/span> start<\/code><\/pre>\n<p>\u4e5f\u53ef\u4ee5\u4f7f\u7528\u914d\u7f6e\u6587\u4ef6\u8fdb\u884c\u914d\u7f6e\uff0c\u65b9\u6cd5\u521b\u5efa\/etc\/shadowsocks.json\u6587\u4ef6\uff0c\u586b\u5165\u5982\u4e0b\u5185\u5bb9\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs json has-numbering\">{\r\n    \"<span class=\"hljs-attribute\">server<\/span>\":<span class=\"hljs-value\"><span class=\"hljs-string\">\"my_server_ip\"<\/span><\/span>,\r\n    \"<span class=\"hljs-attribute\">server_port<\/span>\":<span class=\"hljs-value\"><span class=\"hljs-number\">8388<\/span><\/span>,\r\n    \"<span class=\"hljs-attribute\">local_address<\/span>\": <span class=\"hljs-value\"><span class=\"hljs-string\">\"127.0.0.1\"<\/span><\/span>,\r\n    \"<span class=\"hljs-attribute\">local_port<\/span>\":<span class=\"hljs-value\"><span class=\"hljs-number\">1080<\/span><\/span>,\r\n    \"<span class=\"hljs-attribute\">password<\/span>\":<span class=\"hljs-value\"><span class=\"hljs-string\">\"mypassword\"<\/span><\/span>,\r\n    \"<span class=\"hljs-attribute\">timeout<\/span>\":<span class=\"hljs-value\"><span class=\"hljs-number\">300<\/span><\/span>,\r\n    \"<span class=\"hljs-attribute\">method<\/span>\":<span class=\"hljs-value\"><span class=\"hljs-string\">\"aes-256-cfb\"<\/span>\r\n<\/span>}<\/code><\/pre>\n<p>\u5404\u5b57\u6bb5\u7684\u542b\u4e49\uff1a<\/p>\n<table>\n<thead>\n<tr>\n<th>name<\/th>\n<th>info<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>server<\/td>\n<td>\u670d\u52a1\u5668 IP (IPv4\/IPv6)\uff0c\u6ce8\u610f\u8fd9\u4e5f\u5c06\u662f\u670d\u52a1\u7aef\u76d1\u542c\u7684 IP \u5730\u5740<\/td>\n<\/tr>\n<tr>\n<td>server_port<\/td>\n<td>\u670d\u52a1\u5668\u7aef\u53e3<\/td>\n<\/tr>\n<tr>\n<td>local_port<\/td>\n<td>\u672c\u5730\u7aef\u7aef\u53e3<\/td>\n<\/tr>\n<tr>\n<td>password<\/td>\n<td>\u7528\u6765\u52a0\u5bc6\u7684\u5bc6\u7801<\/td>\n<\/tr>\n<tr>\n<td>timeout<\/td>\n<td>\u8d85\u65f6\u65f6\u95f4\uff08\u79d2\uff09<\/td>\n<\/tr>\n<tr>\n<td>method<\/td>\n<td>\u52a0\u5bc6\u65b9\u6cd5\uff0c\u53ef\u9009\u62e9 \u201cbf-cfb\u201d, \u201caes-256-cfb\u201d, \u201cdes-cfb\u201d, \u201crc4\u2033, \u7b49\u7b49\u3002\u9ed8\u8ba4\u662f\u4e00\u79cd\u4e0d\u5b89\u5168\u7684\u52a0\u5bc6\uff0c\u63a8\u8350\u7528 \u201caes-256-cfb\u201d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>TIPS: \u52a0\u5bc6\u65b9\u5f0f\u63a8\u8350\u4f7f\u7528rc4-md5\uff0c\u56e0\u4e3a RC4 \u6bd4 AES \u901f\u5ea6\u5feb\u597d\u51e0\u500d\uff0c\u5982\u679c\u7528\u5728\u8def\u7531\u5668\u4e0a\u4f1a\u5e26\u6765\u663e\u8457\u6027\u80fd\u63d0\u5347\u3002\u65e7\u7684 RC4 \u52a0\u5bc6\u4e4b\u6240\u4ee5\u4e0d\u5b89\u5168\u662f\u56e0\u4e3a Shadowsocks \u5728\u6bcf\u4e2a\u8fde\u63a5\u4e0a\u91cd\u590d\u4f7f\u7528 key\uff0c\u6ca1\u6709\u4f7f\u7528 IV\u3002\u73b0\u5728\u5df2\u7ecf\u91cd\u65b0\u6b63\u786e\u5b9e\u73b0\uff0c\u53ef\u4ee5\u653e\u5fc3\u4f7f\u7528\u3002\u66f4\u591a\u53ef\u4ee5\u770b issue\u3002<\/p>\n<h3 id=\"title\"><a target=\"_blank\" name=\"t2\"><\/a><\/h3>\n<p>\u521b\u5efa\u5b8c\u6bd5\u540e\uff0c\u8d4b\u4e88\u6587\u4ef6\u6743\u9650\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs bash has-numbering\"><span class=\"hljs-built_in\">sudo<\/span> chmod <span class=\"hljs-number\">755<\/span> \/etc\/shadowsocks.json<\/code><\/pre>\n<p>\u4e3a\u4e86\u652f\u6301\u8fd9\u4e9b\u52a0\u5bc6\u65b9\u5f0f\uff0c\u4f60\u8981\u9700\u8981\u5b89\u88c5<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs bash has-numbering\"><span class=\"hljs-built_in\">sudo<\/span> apt-get install python-m2crypto<\/code><\/pre>\n<p>\u7136\u540e\u4f7f\u7528\u914d\u7f6e\u6587\u4ef6\u5728\u540e\u53f0\u8fd0\u884c\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs bash has-numbering\"><span class=\"hljs-built_in\">sudo<\/span> ssserver -c \/etc\/shadowsocks.json -<span class=\"hljs-operator\">d<\/span> start<\/code><\/pre>\n<h1 id=\"3-\u914d\u7f6e\u5f00\u673a\u81ea\u542f\u52a8\"><a target=\"_blank\" name=\"t3\"><\/a>3. \u914d\u7f6e\u5f00\u673a\u81ea\u542f\u52a8<\/h1>\n<p>\u7f16\u8f91 \/etc\/rc.local \u6587\u4ef6<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs bash has-numbering\"><span class=\"hljs-built_in\">sudo<\/span> vi \/etc\/rc.local<\/code><\/pre>\n<p>\u5728 exit 0 \u8fd9\u4e00\u884c\u7684\u4e0a\u8fb9\u52a0\u5165\u5982\u4e0b<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs lua has-numbering\">\/usr\/<span class=\"hljs-keyword\">local<\/span>\/bin\/ssserver -c \/etc\/shadowsocks.json<\/code><\/pre>\n<p>\u6216\u8005 \u4e0d\u7528\u914d\u7f6e\u6587\u4ef6 \u76f4\u63a5\u52a0\u5165\u547d\u4ee4\u542f\u52a8\u5982\u4e0b\uff1a<\/p>\n<pre class=\"prettyprint\"><code class=\"hljs lasso has-numbering\">\/usr\/<span class=\"hljs-built_in\">local<\/span>\/bin\/ssserver -<span class=\"hljs-attribute\">p<\/span> <span class=\"hljs-number\">8388<\/span> <span class=\"hljs-attribute\">-k<\/span> password <span class=\"hljs-attribute\">-m<\/span> aes<span class=\"hljs-subst\">-<\/span><span class=\"hljs-number\">256<\/span><span class=\"hljs-attribute\">-cfb<\/span> <span class=\"hljs-attribute\">-d<\/span> start<\/code><\/pre>\n<p>\u5230\u6b64\u91cd\u542f\u670d\u52a1\u5668\u540e\uff0c\u4f1a\u81ea\u52a8\u542f\u52a8\u3002<\/p>\n<h1 id=\"\u6ce8\u610f-\u9700\u8981\u670d\u52a1\u5668\u5f00\u542f-8388-\u7aef\u53e3\"><a target=\"_blank\" name=\"t4\"><\/a>\u6ce8\u610f \uff1a\u9700\u8981\u670d\u52a1\u5668\u5f00\u542f 8388 \u7aef\u53e3<\/h1>\n","protected":false},"excerpt":{"rendered":"<p>1. shadowsocks &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-810","post","type-post","status-publish","format-standard","hentry","category-jishu"],"_links":{"self":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts\/810"}],"collection":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=810"}],"version-history":[{"count":0,"href":"http:\/\/alextop.top\/index.php?rest_route=\/wp\/v2\/posts\/810\/revisions"}],"wp:attachment":[{"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=810"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=810"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/alextop.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=810"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}