{"id":532,"date":"2024-10-24T03:55:56","date_gmt":"2024-10-23T19:55:56","guid":{"rendered":"https:\/\/www.ikaros.love\/?p=532"},"modified":"2024-10-24T03:55:56","modified_gmt":"2024-10-23T19:55:56","slug":"ubuntu%e8%ae%be%e7%bd%ae%e5%91%bd%e4%bb%a4%e8%a1%8c%e4%bb%a3%e7%90%86","status":"publish","type":"post","link":"https:\/\/www.ikaros.love\/?p=532","title":{"rendered":"Ubuntu\u8bbe\u7f6e\u547d\u4ee4\u884c\u4ee3\u7406"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"878\" height=\"768\" src=\"https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/78.png\" alt=\"\" class=\"wp-image-533\" srcset=\"https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/78.png 878w, https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/78-300x262.png 300w, https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/78-768x672.png 768w, https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/78-670x586.png 670w\" sizes=\"(max-width: 878px) 100vw, 878px\" \/><\/figure>\n\n\n\n<p>Ubuntu\u8fd9\u4e2a\u7cfb\u7edf\u6ca1\u6709\u5168\u5c40\u4ee3\u7406\u8fd9\u79cd\u8bf4\u6cd5\uff0c\u6bcf\u4e2a\u5e94\u7528\u90fd\u4e0d\u540c\uff0c\u6bd4\u5982\u547d\u4ee4\u884c\u9700\u8981\u8bbe\u7f6e\u547d\u4ee4\u884c\u4ee3\u7406\uff0c\u684c\u9762\u5e94\u7528\u9700\u8981\u5728\u56fe\u5f62\u754c\u9762\u8bbe\u7f6e\u4ee3\u7406\uff0cdocker\u5219\u9700\u8981\u5176\u4ed6\u4ee3\u7406\uff0c\u5f88\u590d\u6742\uff0c\u8fd9\u4e2a\u6587\u7ae0\u4e3b\u8981\u8ba8\u8bba\u547d\u4ee4\u884c\u4ee3\u7406\u3002<\/p>\n\n\n\n<p>\u547d\u4ee4\u884c\u4ee3\u7406\u751f\u6548\u7684\u5e94\u7528\u4e3b\u8981\u751f\u6548\u7684\u5e94\u7528\u6709\u540e\u53f0\u8fd0\u884c\u7684\u5e94\u7528\uff0c\u6bd4\u5982python\uff0cphp\uff0c\u7b49\u540e\u53f0\u670d\u52a1<\/p>\n\n\n\n<p>\u8bbe\u7f6e\u4ee3\u7406\u9700\u8981\u6709\u4e00\u4e2a\u4ee3\u7406\u7684\u670d\u52a1\u5668\uff0c\u8fd9\u91cc\u9009\u62e9\u4e86windows\u7684clash\u7684\u5c40\u57df\u7f51\u4ee3\u7406\u4f5c\u4e3a\u4ee3\u7406\u670d\u52a1<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/image-52-1024x576.png\" alt=\"\" class=\"wp-image-534\" srcset=\"https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/image-52-1024x576.png 1024w, https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/image-52-300x169.png 300w, https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/image-52-768x432.png 768w, https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/image-52-1536x864.png 1536w, https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/image-52-520x293.png 520w, https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/image-52-670x377.png 670w, https:\/\/www.ikaros.love\/wp-content\/uploads\/2024\/10\/image-52.png 1920w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>\u9009\u62e9\u589e\u5f3a\u4ee3\u7406\uff0c\u8981\u5b89\u88c5ServiceMode  \u5f00\u542f\u5c40\u57df\u7f51\u4ee3\u7406\uff0c\u5173\u95ed\u968f\u673a\u5207\u6362\u7aef\u53e3\uff0c\u8bb0\u4f4f\u73b0\u5728\u7684\u7aef\u53e3\u53f7<\/p>\n\n\n\n<p>\u67e5\u770b\u8fd0\u884cclash\u670d\u52a1\u4e3b\u673a\u7684ip<\/p>\n\n\n\n<p>\u767b\u5f55Ubuntu<\/p>\n\n\n\n<p>\u6709\u4e24\u79cd\u4ee3\u7406\u65b9\u5f0f\uff0c\u4e00\u79cd\u662f\u4e34\u65f6\u4ee3\u7406<\/p>\n\n\n\n<p>\u4f7f\u7528http\u4ee3\u7406<\/p>\n\n\n\n<p>export http_proxy=&#8221;http:\/\/127.0.0.1:20171\/&#8221;<br>export https_proxy=&#8221;http:\/\/127.0.0.1:20171\/&#8221;<\/p>\n\n\n\n<p>\u4e0a\u9762\u7684ip\u586b\u5199\u4e0a\u9762\u4e3b\u673a\u7684ip\uff0c\u7aef\u53e3\u662f\u5bf9\u5e94\u7684\u5c40\u57df\u7f51\u7aef\u53e3\u3002<\/p>\n\n\n\n<p>\u4e00\u79cd\u662fsocks\u4ee3\u7406<\/p>\n\n\n\n<p>export http_proxy=&#8221;socks5:\/\/127.0.0.1:20170\/&#8221;<br>export https_proxy=&#8221;socks5:\/\/127.0.0.1:20170\/&#8221;<\/p>\n\n\n\n<p>\u672c\u6559\u7a0b\u4f7f\u7528http\u4ee3\u7406<\/p>\n\n\n\n<p>\u6c38\u4e45\u4ee3\u7406\u8bbe\u7f6e<\/p>\n\n\n\n<p>\u767b\u5f55\u7ec8\u7aefroot\u8d26\u6237<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim ~\/.bashrc <\/code><\/pre>\n\n\n\n<p>\u5728\u540e\u9762\u8ffd\u52a0\u5982\u4e0b\u5185\u5bb9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export http_proxy='http:\/\/192.168.1.101:50121\/'\r\nexport https_proxy='http:\/\/192.168.1.101:50121\/'<\/code><\/pre>\n\n\n\n<p>\u4e0a\u9762\u586b\u5199\u5185\u5bb9\u8bf4\u660e\u5728\u524d\u9762<\/p>\n\n\n\n<p>\u6ce8\u610f\u683c\u5f0f\u8981\u4e25\u8c28\uff0c\u522b\u64c5\u81ea\u6dfb\u52a0\u7a7a\u683c\u6539\u53d8\u6807\u70b9\uff0c\u5426\u5219\u4f1a\u5931\u8d25<\/p>\n\n\n\n<p>\u4fdd\u5b58\u540e\u751f\u6548<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>source ~\/.bashrc<\/code><\/pre>\n\n\n\n<p>\u7ec8\u7aef\u4ee3\u7406\u751f\u6548\u540e\uff0c<strong>\u4e0d\u4e00\u5b9a\u80fdping\u901a<\/strong>\uff0c\u56e0\u4e3a\uff1aping \u4f7f\u7528\u7684\u662f<a href=\"https:\/\/so.csdn.net\/so\/search?q=ICMP%E5%8D%8F%E8%AE%AE&amp;spm=1001.2101.3001.7020\" target=\"_blank\" rel=\"noreferrer noopener\">ICMP\u534f\u8bae<\/a>\uff0cICMP \u5904\u4e8e\u7f51\u7edc\u5c42(\u7b2c\u4e09\u5c42)\uff0c\u800cSOCKS5\u662f\u4f20\u8f93\u5c42\u4ee3\u7406\u534f\u8bae(\u7b2c\u56db\u5c42)\uff0cHTTP\u548cHTTPS\u662f\u5e94\u7528\u5c42\u534f\u8bae(\u7b2c\u4e94\u5c42\u6216\u8005\u7b2c\u4e03\u5c42)\uff0c\u534f\u8bae\u5c42\u4e0d\u540c\u662f\u65e0\u6cd5\u4ee3\u7406\u7684\u3002<\/p>\n\n\n\n<p>\u6d4b\u8bd5\u751f\u6548\u65b9\u6cd5<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl -vv https:\/\/www.github.com<\/code><\/pre>\n\n\n\n<p>\u8f93\u51fa\u5185\u5bb9\u5982\u4e0b<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>root@ikaroswebserver:~# curl -vv https:\/\/www.github.com\r\n* Uses proxy env variable https_proxy == 'http:\/\/192.168.1.101:50121\/'\r\n*   Trying 192.168.1.101:50121...\r\n* Connected to 192.168.1.101 (192.168.1.101) port 50121\r\n* CONNECT tunnel: HTTP\/1.1 negotiated\r\n* allocate connect buffer\r\n* Establish HTTP proxy tunnel to www.github.com:443\r\n> CONNECT www.github.com:443 HTTP\/1.1\r\n> Host: www.github.com:443\r\n> User-Agent: curl\/8.5.0\r\n> Proxy-Connection: Keep-Alive\r\n> \r\n&lt; HTTP\/1.1 200 Connection established\r\n&lt; \r\n* CONNECT phase completed\r\n* CONNECT tunnel established, response 200\r\n* ALPN: curl offers h2,http\/1.1\r\n* TLSv1.3 (OUT), TLS handshake, Client hello (1):\r\n*  CAfile: \/etc\/ssl\/certs\/ca-certificates.crt\r\n*  CApath: \/etc\/ssl\/certs\r\n* TLSv1.3 (IN), TLS handshake, Server hello (2):\r\n* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):\r\n* TLSv1.3 (IN), TLS handshake, Certificate (11):\r\n* TLSv1.3 (IN), TLS handshake, CERT verify (15):\r\n* TLSv1.3 (IN), TLS handshake, Finished (20):\r\n* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):\r\n* TLSv1.3 (OUT), TLS handshake, Finished (20):\r\n* SSL connection using TLSv1.3 \/ TLS_AES_128_GCM_SHA256 \/ X25519 \/ id-ecPublicKey\r\n* ALPN: server accepted h2\r\n* Server certificate:\r\n*  subject: CN=github.com\r\n*  start date: Mar  7 00:00:00 2024 GMT\r\n*  expire date: Mar  7 23:59:59 2025 GMT\r\n*  subjectAltName: host \"www.github.com\" matched cert's \"www.github.com\"\r\n*  issuer: C=GB; ST=Greater Manchester; L=Salford; O=Sectigo Limited; CN=Sectigo ECC Domain Validation Secure Server CA\r\n*  SSL certificate verify ok.\r\n*   Certificate level 0: Public key type EC\/prime256v1 (256\/128 Bits\/secBits), signed using ecdsa-with-SHA256\r\n*   Certificate level 1: Public key type EC\/prime256v1 (256\/128 Bits\/secBits), signed using ecdsa-with-SHA384\r\n*   Certificate level 2: Public key type EC\/secp384r1 (384\/192 Bits\/secBits), signed using ecdsa-with-SHA384\r\n* using HTTP\/2\r\n* &#91;HTTP\/2] &#91;1] OPENED stream for https:\/\/www.github.com\/\r\n* &#91;HTTP\/2] &#91;1] &#91;:method: GET]\r\n* &#91;HTTP\/2] &#91;1] &#91;:scheme: https]\r\n* &#91;HTTP\/2] &#91;1] &#91;:authority: www.github.com]\r\n* &#91;HTTP\/2] &#91;1] &#91;:path: \/]\r\n* &#91;HTTP\/2] &#91;1] &#91;user-agent: curl\/8.5.0]\r\n* &#91;HTTP\/2] &#91;1] &#91;accept: *\/*]\r\n> GET \/ HTTP\/2\r\n> Host: www.github.com\r\n> User-Agent: curl\/8.5.0\r\n> Accept: *\/*\r\n> \r\n* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):\r\n* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):\r\n* old SSL session ID is stale, removing\r\n&lt; HTTP\/2 301 \r\n&lt; content-length: 0\r\n&lt; location: https:\/\/github.com\/\r\n&lt; \r\n* Connection #0 to host 192.168.1.101 left intact<\/code><\/pre>\n\n\n\n<p>\u8be6\u7ec6\u89e3\u91ca\u5982\u4e0b<\/p>\n\n\n\n<p>\u8fd9\u6bb5\u5185\u5bb9\u662f\u4ece\u4f7f\u7528 curl \u547d\u4ee4\u5728 Linux \u7ec8\u7aef\uff08\u7279\u522b\u662f\u4ee5 root \u7528\u6237\u8eab\u4efd\u5728\u540d\u4e3a ikaroswebserver \u7684\u673a\u5668\u4e0a\uff09\u5c1d\u8bd5\u8bbf\u95ee https:\/\/www.github.com \u7684\u8be6\u7ec6\u8f93\u51fa\u3002curl \u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u7528\u4e8e\u4ece\u6216\u5411\u670d\u52a1\u5668\u4f20\u8f93\u6570\u636e\uff0c\u652f\u6301\u591a\u79cd\u534f\u8bae\uff0c\u5305\u62ec HTTP\u3001HTTPS \u548c FTP\u3002\u4e0b\u9762\u662f\u5bf9\u8fd9\u6bb5\u8f93\u51fa\u7684\u8be6\u7ec6\u89e3\u91ca\uff1a<\/p>\n\n\n\n<p>\u4f7f\u7528\u4ee3\u7406:<\/p>\n\n\n\n<ul>\n<li>Uses proxy env variable https_proxy == &#8216;http:\/\/192.168.1.101:50121\/&#8217;<br>\u8fd9\u8868\u660e curl \u6b63\u5728\u4f7f\u7528\u4e00\u4e2a\u73af\u5883\u53d8\u91cf https_proxy \u6307\u5b9a\u7684 HTTP \u4ee3\u7406\u670d\u52a1\u5668\u3002\u4ee3\u7406\u670d\u52a1\u5668\u7684\u5730\u5740\u662f 192.168.1.101\uff0c\u7aef\u53e3\u662f 50121\u3002<br>\u8fde\u63a5\u5230\u4ee3\u7406\u670d\u52a1\u5668:<\/li>\n\n\n\n<li>Trying 192.168.1.101:50121\u2026<\/li>\n\n\n\n<li>Connected to 192.168.1.101 (192.168.1.101) port 50121<br>\u8fd9\u4e24\u884c\u8868\u660e curl \u6b63\u5728\u5c1d\u8bd5\u8fde\u63a5\u5230\u6307\u5b9a\u7684\u4ee3\u7406\u670d\u52a1\u5668\uff0c\u5e76\u4e14\u5df2\u7ecf\u6210\u529f\u8fde\u63a5\u3002<br>\u5efa\u7acb HTTP \u4ee3\u7406\u96a7\u9053:<\/li>\n\n\n\n<li>CONNECT tunnel: HTTP\/1.1 negotiated<\/li>\n\n\n\n<li>Establish HTTP proxy tunnel to www.github.com:443<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p>CONNECT www.github.com:443 HTTP\/1.1<br>Host: www.github.com:443<br>User-Agent: curl\/8.5.0<br>Proxy-Connection: Keep-Alive<br>&lt; HTTP\/1.1 200 Connection established<br>\u8fd9\u51e0\u884c\u663e\u793a curl \u6b63\u5728\u901a\u8fc7\u4ee3\u7406\u670d\u52a1\u5668\u5efa\u7acb\u4e00\u4e2a\u5230 www.github.com \u5728 443 \u7aef\u53e3\u4e0a\u7684 HTTPS \u8fde\u63a5\u7684\u96a7\u9053\u3002\u4ee3\u7406\u670d\u52a1\u5668\u54cd\u5e94 HTTP 200\uff0c\u8868\u793a\u8fde\u63a5\u5df2\u6210\u529f\u5efa\u7acb\u3002<br>TLS\/SSL \u63e1\u624b:<br>\u63a5\u4e0b\u6765\u7684\u51e0\u884c\u63cf\u8ff0\u4e86 TLS\/SSL \u63e1\u624b\u7684\u8fc7\u7a0b\uff0c\u5305\u62ec\u534f\u5546\u7684\u534f\u8bae\u7248\u672c\uff08TLSv1.3\uff09\u3001\u52a0\u5bc6\u7b97\u6cd5\uff08TLS_AES_128_GCM_SHA256\uff09\u3001\u670d\u52a1\u5668\u8bc1\u4e66\u7684\u9a8c\u8bc1\u7b49\u3002<br>\u670d\u52a1\u5668\u8bc1\u4e66\u4fe1\u606f:<br>\u663e\u793a\u4e86\u670d\u52a1\u5668\u8bc1\u4e66\u7684\u8be6\u7ec6\u4fe1\u606f\uff0c\u5305\u62ec\u8bc1\u4e66\u7684\u9881\u53d1\u8005\u3001\u6709\u6548\u671f\u3001\u4e3b\u9898\u548c\u4e3b\u9898\u5907\u7528\u540d\u79f0\uff08SAN\uff09\uff0c\u4ee5\u53ca\u8bc1\u4e66\u94fe\u7684\u9a8c\u8bc1\u3002<br>\u4f7f\u7528 HTTP\/2 \u534f\u8bae:<\/p>\n\n\n\n<ul>\n<li>using HTTP\/2<br>\u8868\u660e curl \u548c github.com \u670d\u52a1\u5668\u4e4b\u95f4\u7684\u901a\u4fe1\u4f7f\u7528\u7684\u662f HTTP\/2 \u534f\u8bae\u3002<br>\u53d1\u9001 GET \u8bf7\u6c42:<br>[HTTP\/2] [1] OPENED stream for https:\/\/www.github.com\/<br>[HTTP\/2] [1] [:method: GET]<br>[HTTP\/2] [1] [:scheme: https]<br>[HTTP\/2] [1] [:authority: www.github.com]<br>[HTTP\/2] [1] [:path: \/]<br>[HTTP\/2] [1] [user-agent: curl\/8.5.0]<br>[HTTP\/2] [1] [accept: <em>\/<\/em>]<br>GET \/ HTTP\/2<br>Host: www.github.com<br>User-Agent: curl\/8.5.0<br>Accept: <em>\/<\/em><br>\u8fd9\u4e9b\u884c\u663e\u793a\u4e86 curl \u901a\u8fc7 HTTP\/2 \u53d1\u9001\u7684 GET \u8bf7\u6c42\u7684\u8be6\u7ec6\u4fe1\u606f\u3002<br>\u91cd\u5b9a\u5411:<br>&lt; HTTP\/2 301<br>&lt; content-length: 0<br>&lt; location: https:\/\/github.com\/<br>\u670d\u52a1\u5668\u8fd4\u56de\u4e86\u4e00\u4e2a 301 \u72b6\u6001\u7801\uff0c\u8868\u793a\u8bf7\u6c42\u7684\u8d44\u6e90\u5df2\u88ab\u6c38\u4e45\u79fb\u52a8\u5230\u65b0\u7684 URL\uff08https:\/\/github.com\/\uff09\u3002\u6ca1\u6709\u8fd4\u56de\u5185\u5bb9\uff08content-length: 0\uff09\uff0c\u4f46\u63d0\u4f9b\u4e86\u65b0\u7684\u4f4d\u7f6e\u3002<br>\u8fde\u63a5\u4fdd\u6301:<\/li>\n\n\n\n<li>Connection #0 to host 192.168.1.101 left intact<br>\u8868\u793a\u4e0e\u4ee3\u7406\u670d\u52a1\u5668\u7684\u8fde\u63a5\u5728\u8bf7\u6c42\u5b8c\u6210\u540e\u4ecd\u7136\u4fdd\u6301\u6253\u5f00\u72b6\u6001\u3002<br>\u603b\u7ed3\uff1a\u8fd9\u6bb5\u8f93\u51fa\u5c55\u793a\u4e86 curl \u547d\u4ee4\u901a\u8fc7 HTTP \u4ee3\u7406\u670d\u52a1\u5668\u5efa\u7acb\u5230 github.com \u7684 HTTPS \u8fde\u63a5\u3001\u8fdb\u884c TLS\/SSL \u63e1\u624b\u3001\u53d1\u9001 HTTP\/2 GET \u8bf7\u6c42\u5e76\u5904\u7406\u91cd\u5b9a\u5411\u54cd\u5e94\u7684\u6574\u4e2a\u8fc7\u7a0b\u3002<\/li>\n<\/ul>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>Ubuntu\u8fd9\u4e2a\u7cfb\u7edf\u6ca1\u6709\u5168\u5c40\u4ee3\u7406&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":533,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,9],"tags":[163,119,161,162],"_links":{"self":[{"href":"https:\/\/www.ikaros.love\/index.php?rest_route=\/wp\/v2\/posts\/532"}],"collection":[{"href":"https:\/\/www.ikaros.love\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ikaros.love\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ikaros.love\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ikaros.love\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=532"}],"version-history":[{"count":1,"href":"https:\/\/www.ikaros.love\/index.php?rest_route=\/wp\/v2\/posts\/532\/revisions"}],"predecessor-version":[{"id":535,"href":"https:\/\/www.ikaros.love\/index.php?rest_route=\/wp\/v2\/posts\/532\/revisions\/535"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ikaros.love\/index.php?rest_route=\/wp\/v2\/media\/533"}],"wp:attachment":[{"href":"https:\/\/www.ikaros.love\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ikaros.love\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=532"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ikaros.love\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}