{"id":54827,"date":"2025-02-18T09:17:36","date_gmt":"2025-02-18T01:17:36","guid":{"rendered":"https:\/\/fwq.ai\/blog\/54827\/"},"modified":"2025-02-18T09:17:36","modified_gmt":"2025-02-18T01:17:36","slug":"%e4%bd%bf%e7%94%a8nohup%e5%91%bd%e4%bb%a4%e5%ae%9e%e7%8e%b0sslocal%e7%9a%84%e5%90%8e%e5%8f%b0%e8%bf%90%e8%a1%8c","status":"publish","type":"post","link":"https:\/\/fwq.ai\/blog\/54827\/","title":{"rendered":"\u4f7f\u7528nohup\u547d\u4ee4\u5b9e\u73b0sslocal\u7684\u540e\u53f0\u8fd0\u884c"},"content":{"rendered":"<h2>\u5f15\u8a00<\/h2>\n<p>\u5728\u73b0\u4ee3\u7f51\u7edc\u73af\u5883\u4e2d\uff0c<em>Shadowsocks<\/em>\u4f5c\u4e3a\u4e00\u79cd\u6d41\u884c\u7684\u4ee3\u7406\u5de5\u5177\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u79d1\u5b66\u4e0a\u7f51\u3002\u4e3a\u4e86\u786e\u4fdd\u5176\u5728\u540e\u53f0\u6301\u7eed\u8fd0\u884c\uff0c<em>nohup<\/em>\u547d\u4ee4\u6210\u4e3a\u4e86\u4e00\u4e2a\u4e0d\u53ef\u6216\u7f3a\u7684\u5de5\u5177\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u63a2\u8ba8\u5982\u4f55\u4f7f\u7528<code>nohup sslocal -c shadowsocks.json &gt; \/dev\/null 2&gt;&amp;1 &amp;<\/code>\u547d\u4ee4\u6765\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\u3002<\/p>\n<h2>\u4ec0\u4e48\u662fnohup\u547d\u4ee4\uff1f<\/h2>\n<p><em>nohup<\/em>\u662f\u4e00\u4e2aLinux\/Unix\u547d\u4ee4\uff0c\u7528\u4e8e\u5728\u7528\u6237\u9000\u51fa\u7ec8\u7aef\u540e\u7ee7\u7eed\u8fd0\u884c\u7a0b\u5e8f\u3002\u5b83\u7684\u5168\u79f0\u662f\u201cno hang up\u201d\uff0c\u5373\u4e0d\u6302\u8d77\u3002\u4f7f\u7528nohup\u547d\u4ee4\u53ef\u4ee5\u786e\u4fdd\u7a0b\u5e8f\u5728\u540e\u53f0\u6301\u7eed\u8fd0\u884c\uff0c\u5373\u4f7f\u7528\u6237\u5173\u95ed\u4e86\u7ec8\u7aef\u3002<\/p>\n<h2>Shadowsocks\u7b80\u4ecb<\/h2>\n<p><em>Shadowsocks<\/em>\u662f\u4e00\u79cd\u5b89\u5168\u7684\u4ee3\u7406\u5de5\u5177\uff0c\u65e8\u5728\u5e2e\u52a9\u7528\u6237\u7ed5\u8fc7\u7f51\u7edc\u9650\u5236\u3002\u5b83\u901a\u8fc7\u52a0\u5bc6\u7528\u6237\u7684\u7f51\u7edc\u6d41\u91cf\uff0c\u4fdd\u62a4\u7528\u6237\u7684\u9690\u79c1\u3002\u4f7f\u7528Shadowsocks\u65f6\uff0c\u7528\u6237\u9700\u8981\u914d\u7f6e\u4e00\u4e2aJSON\u683c\u5f0f\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u901a\u5e38\u547d\u540d\u4e3a<code>shadowsocks.json<\/code>\u3002<\/p>\n<h2>\u5982\u4f55\u4f7f\u7528nohup\u547d\u4ee4\u8fd0\u884csslocal<\/h2>\n<h3>1. \u51c6\u5907\u5de5\u4f5c<\/h3>\n<p>\u5728\u4f7f\u7528nohup\u547d\u4ee4\u4e4b\u524d\uff0c\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86Shadowsocks\u5ba2\u6237\u7aef\uff0c\u5e76\u4e14\u914d\u7f6e\u6587\u4ef6<code>shadowsocks.json<\/code>\u5df2\u7ecf\u6b63\u786e\u8bbe\u7f6e\u3002\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u5305\u542b\u4ee5\u4e0b\u4fe1\u606f\uff1a<\/p>\n<ul>\n<li>\u670d\u52a1\u5668\u5730\u5740<\/li>\n<li>\u670d\u52a1\u5668\u7aef\u53e3<\/li>\n<li>\u52a0\u5bc6\u65b9\u5f0f<\/li>\n<li>\u5bc6\u7801<\/li>\n<\/ul>\n<h3>2. \u4f7f\u7528nohup\u547d\u4ee4<\/h3>\n<p>\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728\u540e\u53f0\u8fd0\u884csslocal\uff1a bash nohup sslocal -c shadowsocks.json &gt; \/dev\/null 2&gt;&amp;1 &amp;<\/p>\n<ul>\n<li><code>nohup<\/code>\uff1a\u786e\u4fdd\u7a0b\u5e8f\u5728\u7ec8\u7aef\u5173\u95ed\u540e\u7ee7\u7eed\u8fd0\u884c\u3002<\/li>\n<li><code>sslocal -c shadowsocks.json<\/code>\uff1a\u6307\u5b9a\u4f7f\u7528\u7684\u914d\u7f6e\u6587\u4ef6\u3002<\/li>\n<li><code>&gt; \/dev\/null<\/code>\uff1a\u5c06\u6807\u51c6\u8f93\u51fa\u91cd\u5b9a\u5411\u5230<code>\/dev\/null<\/code>\uff0c\u5373\u4e22\u5f03\u8f93\u51fa\u3002<\/li>\n<li><code>2&gt;&amp;1<\/code>\uff1a\u5c06\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u6807\u51c6\u8f93\u51fa\u3002<\/li>\n<li><code>&amp;<\/code>\uff1a\u5c06\u547d\u4ee4\u653e\u5165\u540e\u53f0\u6267\u884c\u3002<\/li>\n<\/ul>\n<h3>3. \u68c0\u67e5\u8fd0\u884c\u72b6\u6001<\/h3>\n<p>\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5sslocal\u662f\u5426\u5728\u540e\u53f0\u8fd0\u884c\uff1a bash ps aux | grep sslocal<\/p>\n<h2>\u5e38\u89c1\u95ee\u9898\u89e3\u7b54<\/h2>\n<h3>1. nohup\u547d\u4ee4\u6709\u4ec0\u4e48\u4f5c\u7528\uff1f<\/h3>\n<p><em>nohup<\/em>\u547d\u4ee4\u7684\u4e3b\u8981\u4f5c\u7528\u662f\u5141\u8bb8\u7a0b\u5e8f\u5728\u7528\u6237\u9000\u51fa\u7ec8\u7aef\u540e\u7ee7\u7eed\u8fd0\u884c\uff0c\u907f\u514d\u56e0\u7ec8\u7aef\u5173\u95ed\u800c\u5bfc\u81f4\u7a0b\u5e8f\u4e2d\u65ad\u3002<\/p>\n<h3>2. \u5982\u4f55\u67e5\u770bnohup\u547d\u4ee4\u7684\u8f93\u51fa\uff1f<\/h3>\n<p>\u5982\u679c\u6ca1\u6709\u5c06\u8f93\u51fa\u91cd\u5b9a\u5411\u5230<code>\/dev\/null<\/code>\uff0c\u53ef\u4ee5\u5728\u5f53\u524d\u76ee\u5f55\u4e0b\u627e\u5230\u4e00\u4e2a\u540d\u4e3a<code>nohup.out<\/code>\u7684\u6587\u4ef6\uff0c\u91cc\u9762\u5305\u542b\u4e86\u7a0b\u5e8f\u7684\u8f93\u51fa\u4fe1\u606f\u3002<\/p>\n<h3>3. \u4f7f\u7528nohup\u547d\u4ee4\u65f6\u9700\u8981\u6ce8\u610f\u4ec0\u4e48\uff1f<\/h3>\n<ul>\n<li>\u786e\u4fdd\u547d\u4ee4\u7684\u6b63\u786e\u6027\uff0c\u5c24\u5176\u662f\u8def\u5f84\u548c\u6587\u4ef6\u540d\u3002<\/li>\n<li>\u9002\u5f53\u91cd\u5b9a\u5411\u8f93\u51fa\uff0c\u4ee5\u514d\u4ea7\u751f\u8fc7\u591a\u7684\u65e5\u5fd7\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<h3>4. \u5982\u4f55\u505c\u6b62\u8fd0\u884c\u7684sslocal\uff1f<\/h3>\n<p>\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u627e\u5230sslocal\u7684\u8fdb\u7a0bID\u5e76\u7ec8\u6b62\u5b83\uff1a bash kill <\/p>\n<h2>\u7ed3\u8bba<\/h2>\n<p>\u4f7f\u7528<code>nohup sslocal -c shadowsocks.json &gt; \/dev\/null 2&gt;&amp;1 &amp;<\/code>\u547d\u4ee4\u53ef\u4ee5\u6709\u6548\u5730\u5728\u540e\u53f0\u8fd0\u884cShadowsocks\uff0c\u786e\u4fdd\u5176\u6301\u7eed\u5de5\u4f5c\u3002\u638c\u63e1\u8fd9\u4e00\u6280\u5de7\uff0c\u5c06\u5927\u5927\u63d0\u5347\u7528\u6237\u7684\u7f51\u7edc\u4f53\u9a8c\u3002<\/p>\n<h2>\u53c2\u8003\u8d44\u6599<\/h2>\n<ul>\n<li><\/li>\n<li><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u5f15\u8a00 \u5728\u73b0\u4ee3\u7f51\u7edc\u73af\u5883\u4e2d\uff0cShadowsocks\u4f5c\u4e3a\u4e00\u79cd\u6d41\u884c\u7684\u4ee3\u7406\u5de5\u5177\uff0c\u5e7f\u6cdb\u5e94\u7528\u4e8e\u79d1\u5b66\u4e0a\u7f51\u3002\u4e3a\u4e86\u786e\u4fdd\u5176\u5728\u540e\u53f0\u6301\u7eed\u8fd0\u884c\uff0cnohup\u547d\u4ee4\u6210\u4e3a\u4e86\u4e00\u4e2a\u4e0d\u53ef\u6216\u7f3a\u7684\u5de5\u5177\u3002\u672c\u6587\u5c06\u8be6\u7ec6\u63a2\u8ba8\u5982\u4f55\u4f7f\u7528nohup sslocal -c shadowsocks.json &gt; \/dev\/null 2&gt;&amp;1 &amp;\u547d\u4ee4\u6765\u5b9e\u73b0\u8fd9\u4e00\u76ee\u6807\u3002 \u4ec0\u4e48\u662fnohup\u547d\u4ee4\uff1f nohup\u662f\u4e00\u4e2aLinux\/Unix\u547d\u4ee4\uff0c\u7528\u4e8e\u5728\u7528\u6237\u9000\u51fa\u7ec8\u7aef\u540e\u7ee7\u7eed\u8fd0\u884c\u7a0b\u5e8f\u3002\u5b83\u7684\u5168\u79f0\u662f\u201cno hang up\u201d\uff0c\u5373\u4e0d\u6302\u8d77\u3002\u4f7f\u7528nohup\u547d\u4ee4\u53ef\u4ee5\u786e\u4fdd\u7a0b\u5e8f\u5728\u540e\u53f0\u6301\u7eed\u8fd0\u884c\uff0c\u5373\u4f7f\u7528\u6237\u5173\u95ed\u4e86\u7ec8\u7aef\u3002 Shadowsocks\u7b80\u4ecb Shadowsocks\u662f\u4e00\u79cd\u5b89\u5168\u7684\u4ee3\u7406\u5de5\u5177\uff0c\u65e8\u5728\u5e2e\u52a9\u7528\u6237\u7ed5\u8fc7\u7f51\u7edc\u9650\u5236\u3002\u5b83\u901a\u8fc7\u52a0\u5bc6\u7528\u6237\u7684\u7f51\u7edc\u6d41\u91cf\uff0c\u4fdd\u62a4\u7528\u6237\u7684\u9690\u79c1\u3002\u4f7f\u7528Shadowsocks\u65f6\uff0c\u7528\u6237\u9700\u8981\u914d\u7f6e\u4e00\u4e2aJSON\u683c\u5f0f\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u901a\u5e38\u547d\u540d\u4e3ashadowsocks.json\u3002 \u5982\u4f55\u4f7f\u7528nohup\u547d\u4ee4\u8fd0\u884csslocal 1. \u51c6\u5907\u5de5\u4f5c \u5728\u4f7f\u7528nohup\u547d\u4ee4\u4e4b\u524d\uff0c\u786e\u4fdd\u5df2\u7ecf\u5b89\u88c5\u4e86Shadowsocks\u5ba2\u6237\u7aef\uff0c\u5e76\u4e14\u914d\u7f6e\u6587\u4ef6shadowsocks.json\u5df2\u7ecf\u6b63\u786e\u8bbe\u7f6e\u3002\u914d\u7f6e\u6587\u4ef6\u901a\u5e38\u5305\u542b\u4ee5\u4e0b\u4fe1\u606f\uff1a \u670d\u52a1\u5668\u5730\u5740 \u670d\u52a1\u5668\u7aef\u53e3 \u52a0\u5bc6\u65b9\u5f0f \u5bc6\u7801 2. \u4f7f\u7528nohup\u547d\u4ee4 \u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u5728\u540e\u53f0\u8fd0\u884csslocal\uff1a bash nohup sslocal -c shadowsocks.json &gt; \/dev\/null 2&gt;&amp;1 &amp; nohup\uff1a\u786e\u4fdd\u7a0b\u5e8f\u5728\u7ec8\u7aef\u5173\u95ed\u540e\u7ee7\u7eed\u8fd0\u884c\u3002 sslocal -c shadowsocks.json\uff1a\u6307\u5b9a\u4f7f\u7528\u7684\u914d\u7f6e\u6587\u4ef6\u3002 &gt; \/dev\/null\uff1a\u5c06\u6807\u51c6\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\/dev\/null\uff0c\u5373\u4e22\u5f03\u8f93\u51fa\u3002 2&gt;&amp;1\uff1a\u5c06\u6807\u51c6\u9519\u8bef\u8f93\u51fa\u91cd\u5b9a\u5411\u5230\u6807\u51c6\u8f93\u51fa\u3002 &amp;\uff1a\u5c06\u547d\u4ee4\u653e\u5165\u540e\u53f0\u6267\u884c\u3002 3. \u68c0\u67e5\u8fd0\u884c\u72b6\u6001 \u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u68c0\u67e5sslocal\u662f\u5426\u5728\u540e\u53f0\u8fd0\u884c\uff1a bash ps aux | grep sslocal \u5e38\u89c1\u95ee\u9898\u89e3\u7b54 1. nohup\u547d\u4ee4\u6709\u4ec0\u4e48\u4f5c\u7528\uff1f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-54827","post","type-post","status-publish","format-standard","hentry","category-vpn"],"_links":{"self":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/54827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/comments?post=54827"}],"version-history":[{"count":0,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/posts\/54827\/revisions"}],"wp:attachment":[{"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/media?parent=54827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/categories?post=54827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fwq.ai\/blog\/wp-json\/wp\/v2\/tags?post=54827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}