{"id":656,"date":"2017-10-21T07:20:58","date_gmt":"2017-10-20T23:20:58","guid":{"rendered":"https:\/\/www.datarelab.com\/blog\/?p=656"},"modified":"2017-10-21T07:21:43","modified_gmt":"2017-10-20T23:21:43","slug":"centos-%e4%b8%8a%e5%ae%89%e8%a3%85shadowsocks%e6%9c%8d%e5%8a%a1%e7%ab%af","status":"publish","type":"post","link":"https:\/\/www.datarelab.com\/blog\/Technical_literature\/656.html","title":{"rendered":"CentOS\u4e0a\u5b89\u88c5ShadowSocks\u670d\u52a1\u7aef"},"content":{"rendered":"<p>1\u3001\u67e5\u770b\u7cfb\u7edf<br \/>\n[root@localhost ~]# cat \/etc\/issue<br \/>\nCentOS release 6.6 (Final)<br \/>\n[root@localhost ~]# uname -a<br \/>\nLinux localhost.localdomain 2.6.32-042stab106.6 #1 SMP Mon Apr 20 14:48:47 MSK 2015 x86_64 x86_64 x86_64 GNU\/Linux<\/p>\n<p>2\u3001\u5b89\u88c5ShadowSocks<br \/>\n<strong># yum install python-setuptools &amp;&amp; easy_install pip<\/strong><br \/>\n<strong> # pip install shadowsocks<\/strong><\/p>\n<p>3\u3001\u521b\u5efa\u914d\u7f6e\u6587\u4ef6\/etc\/shadowsocks.json<br \/>\n[root@localhost \/]# touch \/etc\/shadowsocks.json<br \/>\n[root@localhost \/]# vi \/etc\/shadowsocks.json<br \/>\n\/\/\u5355\u7528\u6237\u914d\u7f6e<br \/>\n{<br \/>\n\"server\":\"***.***.***.***\",<br \/>\n\"server_port\":8388,<br \/>\n\"local_address\": \"127.0.0.1\",<br \/>\n\"local_port\":1080,<br \/>\n\"password\":\"MyPass\",<br \/>\n\"timeout\":600,<br \/>\n\"method\":\"rc4-md5\"<br \/>\n}<br \/>\n\/\/\u591a\u7528\u6237\u7684\u914d\u7f6e<br \/>\n{<br \/>\n\"server\":\"***.***.***.***\",<br \/>\n\"port_password\":{<br \/>\n\"9001\":\"pwd001\",<br \/>\n\"9002\":\"pwd002\",<br \/>\n\"9003\":\"pwd003\"<br \/>\n},<br \/>\n\"local_address\":\"127.0.0.1\",<br \/>\n\"local_port\":1080,<br \/>\n\"timeout\":300,<br \/>\n\"method\":\"rc4-md5\"<br \/>\n}<\/p>\n<p>\u5907\u6ce8\uff1a\u52a0\u5bc6\u65b9\u5f0f\u5b98\u65b9\u9ed8\u8ba4\u4f7f\u7528aes-256-cfb\uff0c\u63a8\u8350\u4f7f\u7528rc4-md5\uff0c\u56e0\u4e3a RC4\u6bd4AES\u901f\u5ea6\u5feb\u597d\u51e0\u500d\u3002<br \/>\n\u5404\u5b57\u6bb5\u8bf4\u660e\uff1a<\/p>\n<p>server:\u670d\u52a1\u5668\u7684IP\uff0cVPS\u7684\u516c\u7f51IP\uff0c\u6ce8\u610f\u8fd9\u4e5f\u5c06\u662f\u670d\u52a1\u7aef\u76d1\u542c\u7684IP\u5730\u5740<br \/>\nserver_port:\u670d\u52a1\u5668\u7aef\u53e3<br \/>\nlocal_port:\u672c\u5730\u7aef\u7aef\u53e3<br \/>\npassword:\u7528\u6765\u52a0\u5bc6\u7684\u5bc6\u7801<br \/>\ntimeout:\u8d85\u65f6\u65f6\u95f4\uff08\u79d2\uff09<br \/>\nmethod:\u52a0\u5bc6\u65b9\u5f0f\u3002\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\u3002<br \/>\nTips\uff1a\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<\/p>\n<p>4\u3001\u4f7f\u7528\u914d\u7f6e\u6587\u4ef6\u5728\u540e\u53f0\u8fd0\u884cshadowsocks\u670d\u52a1<br \/>\n[root@localhost \/]# ssserver -c \/etc\/shadowsocks.json -d start<\/p>\n<p>\u5907\u6ce8\uff1a\u82e5\u65e0\u914d\u7f6e\u6587\u4ef6\uff0c\u5728\u540e\u53f0\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e0b\u547d\u4ee4\u8fd0\u884c\uff1a<br \/>\n[root@localhost \/]# ssserver -p 443 -k MyPass -m rc4-md5 -d start<\/p>\n<p>5\u3001\u505c\u6b62\u670d\u52a1<br \/>\n[root@localhost \/]# ssserver -c \/etc\/shadowsocks.json -d stop<\/p>\n<p>6\u3001\u914d\u7f6e\u5f00\u673a\u81ea\u542f\u52a8<br \/>\n\u7f16\u8f91 \/etc\/rc.local \u6587\u4ef6<br \/>\nsudo vim \/etc\/rc.local<br \/>\n\u5728exit 0 \u8fd9\u4e00\u884c\u7684\u4e0a\u8fb9\u52a0\u5165\u5982\u4e0b<br \/>\n\/usr\/local\/bin\/ssserver \u2013c \/etc\/shadowsocks.json<\/p>\n","protected":false},"excerpt":{"rendered":"<p>1\u3001\u67e5\u770b\u7cfb\u7edf [root@localhost ~]# cat \/etc\/issue CentOS releas [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-656","post","type-post","status-publish","format-standard","hentry","category-Technical_literature"],"views":2875,"_links":{"self":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/656","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/comments?post=656"}],"version-history":[{"count":0,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/posts\/656\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/media?parent=656"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/categories?post=656"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.datarelab.com\/blog\/wp-json\/wp\/v2\/tags?post=656"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}