{"id":655,"date":"2023-02-26T13:47:47","date_gmt":"2023-02-26T05:47:47","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=655"},"modified":"2023-04-29T18:44:19","modified_gmt":"2023-04-29T10:44:19","slug":"build-shadowsocks-server-under-centos","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/02\/26\/build-shadowsocks-server-under-centos\/","title":{"rendered":"CentOS\u4e0b\u642d\u5efaShadowsocks\u670d\u52a1\u5668"},"content":{"rendered":"<h4>\u5b89\u88c5Shadowsocks<\/h4>\n<pre><code class=\"language-bash\">yum install python-setuptools &amp;&amp; easy_install pip\npip install shadowsocks<\/code><\/pre>\n<h4>\u521b\u5efa\u914d\u7f6e\u6587\u4ef6<\/h4>\n<p><!-- more --><\/p>\n<pre><code class=\"language-bash\">vim \/etc\/shadowsocks.json\n{\n  &quot;server&quot;: &quot;0.0.0.0&quot;,\n  &quot;server_port&quot;: 8688,\n  &quot;password&quot;: &quot;xxxxxx&quot;,\n  &quot;timeout&quot;: 300,\n  &quot;method&quot;: &quot;rc4-md5&quot;,\n  &quot;fast_open&quot;: false,\n  &quot;workers&quot;: 1\n}<\/code><\/pre>\n<p>\u4ee3\u7801\u4e2d\u5404\u5b57\u6bb5\u7684\u542b\u4e49\uff1a<\/p>\n<ul>\n<li>server\uff1a\u670d\u52a1\u5668 IP\u5730\u5740 (IPv4\/IPv6)<\/li>\n<li>server_port\uff1a\u670d\u52a1\u5668\u76d1\u542c\u7684\u7aef\u53e3\uff0c\u4e00\u822c\u8bbe\u4e3a80\uff0c443\u7b49\uff0c\u6ce8\u610f\u4e0d\u8981\u8bbe\u4e3a\u4f7f\u7528\u4e2d\u7684\u7aef\u53e3<\/li>\n<li>password\uff1a\u8bbe\u7f6e\u5bc6\u7801\uff0c\u81ea\u5b9a\u4e49<\/li>\n<li>timeout\uff1a\u8d85\u65f6\u65f6\u95f4\uff08\u79d2\uff09<\/li>\n<li>method\uff1a\u52a0\u5bc6\u65b9\u6cd5\uff0c\u53ef\u9009\u62e9 \u201caes-256-cfb\u201d, \u201crc4-md5\u201d\u7b49\u7b49\u3002\u63a8\u8350\u4f7f\u7528 \u201crc4-md5\u201d<\/li>\n<li>fast_open\uff1atrue \u6216 false\u3002\u5982\u679c\u4f60\u7684\u670d\u52a1\u5668 Linux \u5185\u6838\u57283.7+\uff0c\u53ef\u4ee5\u5f00\u542f fast_open \u4ee5\u964d\u4f4e\u5ef6\u8fdf\u3002<\/li>\n<li>workers\uff1aworkers\u6570\u91cf\uff0c\u9ed8\u8ba4\u4e3a 1\u3002<\/li>\n<\/ul>\n<p>\u5907\u6ce8\uff1a\u5982\u8981\u4f60\u9700\u8981\u5206\u4eabSS\u670d\u52a1\u7ed9\u670b\u53cb\u6216\u5bb6\u4eba\uff0c\u53ef\u4ee5\u914d\u7f6e\u591a\u4e2aSS\u8d26\u6237\uff0c\u5177\u4f53\u53ef\u4ee5\u53c2\u8003\u4e0b\u9762\u7684\u4ee3\u7801\u3002<\/p>\n<pre><code class=\"language-bash\">{\n  &quot;server&quot;: &quot;your_server_ip&quot;,\n  &quot;port_password&quot;: {\n    &quot;8681&quot;: &quot;pass1&quot;,\n    &quot;8682&quot;: &quot;pass2&quot;,\n    &quot;8683&quot;: &quot;pass3&quot;,\n    &quot;8684&quot;: &quot;pass4&quot;\n    },\n  &quot;timeout&quot;: 60,\n  &quot;method&quot;: &quot;rc4-md5&quot;,\n  &quot;fast_open&quot;: false,\n  &quot;workers&quot;: 1\n}<\/code><\/pre>\n<h4>\u542f\u52a8<\/h4>\n<pre><code class=\"language-bash\">ssserver -c \/etc\/shadowsocks.json -d start<\/code><\/pre>\n<p>\u6216\u4e0d\u9700\u8981\u914d\u7f6e\u6587\u4ef6<\/p>\n<pre><code class=\"language-bash\">sudo ssserver -p 443 -k password -m rc4-md5 --user nobody -d start<\/code><\/pre>\n<h4>\u5173\u95ed<\/h4>\n<pre><code class=\"language-bash\">ssserver -d stop<\/code><\/pre>\n<h4>\u65e5\u5fd7\u6587\u4ef6<\/h4>\n<pre><code class=\"language-bash\">\/var\/log\/shadowsocks.log<\/code><\/pre>\n<h4>\u5e2e\u52a9<\/h4>\n<pre><code class=\"language-shell\">ssserver -h<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u5b89\u88c5Shadowsocks yum install python-setuptools &amp;&amp;  [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[141],"class_list":["post-655","post","type-post","status-publish","format-standard","hentry","category-devops-base","tag-ssr"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=655"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/655\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}