{"id":372,"date":"2025-07-19T20:55:33","date_gmt":"2025-07-19T12:55:33","guid":{"rendered":"https:\/\/www.hgfwq.com\/blog\/?p=372"},"modified":"2025-07-19T20:55:33","modified_gmt":"2025-07-19T12:55:33","slug":"ubuntu%e6%90%ad%e5%bb%basocks5%e7%9a%84%e7%90%86%e7%94%b1%e4%b8%8e%e4%bc%98%e5%8a%bf%e8%a7%a3%e6%9e%90","status":"publish","type":"post","link":"https:\/\/www.hgfwq.com\/blog\/372.html","title":{"rendered":"Ubuntu\u642d\u5efaSOCKS5\u7684\u7406\u7531\u4e0e\u4f18\u52bf\u89e3\u6790"},"content":{"rendered":"<p><h3>\u4ec0\u4e48\u662fSOCKS5<\/h3>\n<\/p>\n<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/www.hgfwq.com\/blog\/wp-content\/uploads\/2025\/07\/I30R6L0Pw6.jpg\" alt=\"Ubuntu\u642d\u5efaSOCKS5\u7684\u7406\u7531\u4e0e\u4f18\u52bf\u89e3\u6790\" title=\"Ubuntu\u642d\u5efaSOCKS5\u7684\u7406\u7531\u4e0e\u4f18\u52bf\u89e3\u6790\"><\/p>\n<p><p>SOCKS5\u662f\u4e00\u79cd\u7f51\u7edc\u4ee3\u7406\u534f\u8bae\uff0c\u7528\u4e8e\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u5b83\u53ef\u4ee5\u5728\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u5efa\u7acb\u52a0\u5bc6\u7684\u96a7\u9053\uff0c\u4fdd\u62a4\u6570\u636e\u4f20\u8f93\u7684\u5b89\u5168\u6027\u3002SOCKS5\u652f\u6301\u591a\u79cd\u8ba4\u8bc1\u65b9\u5f0f\uff0c\u5982\u7528\u6237\u540d\u5bc6\u7801\u8ba4\u8bc1\u3001\u65e0\u8ba4\u8bc1\u7b49\u3002<\/p>\n<\/p>\n<p><h3>\u5728Ubuntu\u4e0a\u642d\u5efaSOCKS5\u4ee3\u7406\u7684\u6b65\u9aa4<\/h3>\n<\/p>\n<p><p>1. <strong>\u5b89\u88c5SOCKS5\u670d\u52a1\u5668\u8f6f\u4ef6<\/strong><\/p>\n<\/p>\n<p>\n<pre><code>sudo apt update<\/p>\r\n<p>sudo apt install privoxy<\/code><\/pre>\n<\/p>\n<p><p>2. <strong>\u914d\u7f6eSOCKS5\u670d\u52a1\u5668<\/strong><\/p>\n<\/p>\n<p><p>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6 <code>\/etc\/privoxy\/config<\/code>\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff1a<\/p>\n<\/p>\n<p>\n<pre><code>forward-socks5 \/ 127.0.0.1:1080 .<\/code><\/pre>\n<\/p>\n<p><p>\u8fd9\u91cc\uff0c<code>127.0.0.1:1080<\/code> \u662fSOCKS5\u670d\u52a1\u5668\u7684\u76d1\u542c\u5730\u5740\u548c\u7aef\u53e3\u3002<\/p>\n<\/p>\n<p><p>3. <strong>\u542f\u52a8\u548c\u542f\u7528SOCKS5\u670d\u52a1\u5668<\/strong><\/p>\n<\/p>\n<p>\n<pre><code>sudo systemctl start privoxy<\/p>\r\n<p>sudo systemctl enable privoxy<\/code><\/pre>\n<\/p>\n<p><p>4. <strong>\u8bbe\u7f6e\u6d4f\u89c8\u5668\u4f7f\u7528SOCKS5\u4ee3\u7406<\/strong><\/p>\n<\/p>\n<p><p>\u5728\u6d4f\u89c8\u5668\u7684\u8bbe\u7f6e\u4e2d\uff0c\u5c06\u4ee3\u7406\u8bbe\u7f6e\u4e3aSOCKS5\uff0c\u5e76\u8f93\u5165\u521a\u624d\u914d\u7f6e\u7684\u76d1\u542c\u5730\u5740\u548c\u7aef\u53e3\u3002<\/p>\n<\/p>\n<p><h3>\u63a8\u8350\u7684SOCKS5\u670d\u52a1\u5668\u8f6f\u4ef6<\/h3>\n<\/p>\n<p><p>\u5728Ubuntu\u4e0a\u642d\u5efaSOCKS5\u4ee3\u7406\uff0c\u63a8\u8350\u4f7f\u7528<code>privoxy<\/code>\u8f6f\u4ef6\u3002\u5b83\u662f\u4e00\u6b3e\u529f\u80fd\u5f3a\u5927\u7684\u4ee3\u7406\u670d\u52a1\u5668\u8f6f\u4ef6\uff0c\u652f\u6301\u591a\u79cd\u4ee3\u7406\u534f\u8bae\uff0c\u6613\u4e8e\u914d\u7f6e\u548c\u4f7f\u7528\u3002<\/p>\n<\/p>\n<p><h3>\u4e3a\u4ec0\u4e48\u9009\u62e9SOCKS5\u4ee3\u7406<\/h3>\n<\/p>\n<p><p>SOCKS5\u4ee3\u7406\u5177\u6709\u4ee5\u4e0b\u4f18\u70b9\uff1a<\/p>\n<\/p>\n<p>\n<ul>\n<li>\u652f\u6301\u591a\u79cd\u8ba4\u8bc1\u65b9\u5f0f\uff0c\u5b89\u5168\u6027\u8f83\u9ad8\u3002<\/li>\n<li>\u53ef\u4ee5\u7ed5\u8fc7\u7f51\u7edc\u9650\u5236\uff0c\u8bbf\u95ee\u88ab\u5c01\u9501\u7684\u7f51\u7ad9\u3002<\/li>\n<li>\u4fdd\u62a4\u7528\u6237\u9690\u79c1\uff0c\u9632\u6b62\u6570\u636e\u6cc4\u9732\u3002<\/li>\n<\/ul>\n<\/p>\n<p><h3>\u5e38\u89c1\u95ee\u9898\u89e3\u7b54<\/h3>\n<\/p>\n<p><p><b>\u5982\u4f55\u8bbe\u7f6eSOCKS5\u4ee3\u7406\u7684\u8ba4\u8bc1\u65b9\u5f0f\uff1f<\/b><\/p>\n<\/p>\n<p><p>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6 <code>\/etc\/privoxy\/config<\/code>\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u884c\u6765\u8bbe\u7f6e\u7528\u6237\u540d\u548c\u5bc6\u7801\uff1a<\/p>\n<\/p>\n<p>\n<pre><code>user auth on<\/p>\r\n<p>user realm \"Privoxy\"<\/p>\r\n<p>user pass \"your_password\"<\/p>\r\n<p>user group \"users\"<\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\uff0c\u5728\u6d4f\u89c8\u5668\u7684\u4ee3\u7406\u8bbe\u7f6e\u4e2d\u8f93\u5165\u6b63\u786e\u7684\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002<\/p>\n<\/p>\n<p><p><b>\u5982\u4f55\u67e5\u770bSOCKS5\u4ee3\u7406\u7684\u8fde\u63a5\u72b6\u6001\uff1f<\/b><\/p>\n<\/p>\n<p><p>\u53ef\u4ee5\u4f7f\u7528<code>netstat<\/code>\u547d\u4ee4\u67e5\u770bSOCKS5\u4ee3\u7406\u7684\u8fde\u63a5\u72b6\u6001\uff1a<\/p>\n<\/p>\n<p>\n<pre><code>sudo netstat -tulnp | grep 1080<\/code><\/pre>\n<\/p>\n<p><p>\u5176\u4e2d\uff0c1080\u662fSOCKS5\u4ee3\u7406\u7684\u76d1\u542c\u7aef\u53e3\u3002<\/p>\n<\/p>\n<p><p><b>\u5982\u4f55\u4fee\u6539SOCKS5\u4ee3\u7406\u7684\u76d1\u542c\u5730\u5740\u548c\u7aef\u53e3\uff1f<\/b><\/p>\n<\/p>\n<p><p>\u7f16\u8f91\u914d\u7f6e\u6587\u4ef6 <code>\/etc\/privoxy\/config<\/code>\uff0c\u5c06\u4ee5\u4e0b\u884c\u4e2d\u7684\u5730\u5740\u548c\u7aef\u53e3\u4fee\u6539\u4e3a\u4f60\u60f3\u8981\u7684\u5730\u5740\u548c\u7aef\u53e3\uff1a<\/p>\n<\/p>\n<p>\n<pre><code>forward-socks5 \/ 127.0.0.1:1080 .<\/code><\/pre>\n<\/p>\n<p><p>\u7136\u540e\u91cd\u542fprivoxy\u670d\u52a1\u4ee5\u4f7f\u914d\u7f6e\u751f\u6548\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u4e48\u662fSOCKS5 SOCKS5\u662f\u4e00\u79cd\u7f51\u7edc\u4ee3\u7406\u534f\u8bae\uff0c\u7528\u4e8e\u5ba2\u6237\u7aef\u4e0e\u670d\u52a1\u5668\u4e4b\u95f4\u7684\u901a\u4fe1\u3002\u5b83\u53ef\u4ee5\u5728\u5ba2\u6237\u7aef\u548c\u670d\u52a1\u5668\u4e4b\u95f4\u5efa\u7acb\u52a0\u5bc6\u7684\u96a7\u9053\uff0c\u4fdd\u62a4\u6570\u636e\u4f20\u8f93\u7684\u5b89\u5168\u6027\u3002SOCKS5\u652f\u6301\u591a\u79cd\u8ba4\u8bc1\u65b9\u5f0f\uff0c\u5982\u7528\u6237\u540d\u5bc6\u7801\u8ba4\u8bc1\u3001\u65e0\u8ba4\u8bc1\u7b49\u3002 \u5728Ubuntu\u4e0a\u642d\u5efaSOCKS5\u4ee3&#8230;<\/p>\n","protected":false},"author":1,"featured_media":373,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[187,188,8],"topic":[],"class_list":["post-372","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-haiwai","tag-socks","tag-sudo","tag-8"],"_links":{"self":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts\/372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/comments?post=372"}],"version-history":[{"count":1,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts\/372\/revisions"}],"predecessor-version":[{"id":375,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/posts\/372\/revisions\/375"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/media\/373"}],"wp:attachment":[{"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/media?parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/categories?post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/tags?post=372"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.hgfwq.com\/blog\/wp-json\/wp\/v2\/topic?post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}