{"id":1320,"date":"2024-07-19T14:18:40","date_gmt":"2024-07-19T06:18:40","guid":{"rendered":"http:\/\/118.178.124.79\/wordpress\/?p=1320"},"modified":"2024-07-19T14:19:14","modified_gmt":"2024-07-19T06:19:14","slug":"linux%e7%b3%bb%e7%bb%9f%e6%8c%82vpn","status":"publish","type":"post","link":"https:\/\/minglelu.cn\/index.php\/2024\/07\/19\/1320\/","title":{"rendered":"linux\u7cfb\u7edf\u6302vpn"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\u5b89\u88c5\u4f9d\u8d56\u8f6f\u4ef6\n\u9996\u5148\u5b89\u88c5\u811a\u672c\u7684\u4f9d\u8d56\u8f6f\u4ef6\uff0c\u6839\u636e\u4f60\u7684 Linux \u53d1\u884c\u7248\u9009\u62e9\u4ee5\u4e0b\u547d\u4ee4\u3002\n\n\u6ce8\u610f\uff1a\u4e0b\u6587\u4e2d\u9700\u8981\u4f60\u8f93\u5165\u7684\u547d\u4ee4\u5747\u4ee5 $ \u5f00\u5934\uff0c\u5176\u4ed6\u5185\u5bb9\u5747\u6765\u81ea\u7cfb\u7edf\u6267\u884c\u547d\u4ee4\u7684\u53cd\u9988\uff0c\u4f60\u53ef\u4ee5\u901a\u8fc7\u6bd4\u8f83\u81ea\u5df1\u5c4f\u5e55\u4e0a\u548c\u6587\u6863\u4e2d\u5185\u5bb9\u7684\u5f02\u540c\u6765\u5224\u65ad\u5b89\u88c5\u662f\u5426\u6b63\u786e\u3002\n\nDebian\/Ubuntu:\n\n$ apt update\n$ apt install curl\nCentOS\/RedHat :\n\n$ yum makecache\n$ yum install curl\nFedora:\n\n$ dnf makecache\n$ dnf install curl\nopenSUSE\/SUSE:\n\n$ zypper refresh\n$ zypper install curl\n#\u4e0b\u8f7d\u5b89\u88c5\u811a\u672c\n\u4e0b\u8f7d\u4e3b\u7a0b\u5e8f\u5b89\u88c5\u811a\u672c\uff1a\n\n$ curl -O https:\/\/raw.githubusercontent.com\/v2fly\/fhs-install-v2ray\/master\/install-release.sh\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:--  0:00:01 --:--:--     0\n100 21613  100 21613    0     0   8732      0  0:00:02  0:00:02 --:--:--  8736\n#\u6267\u884c\u5b89\u88c5\n\u5b89\u88c5 V2ray \u4e3b\u7a0b\u5e8f\uff1a\n\n$ bash install-release.sh\nDownloading V2Ray archive: https:\/\/github.com\/v2fly\/v2ray-core\/releases\/download\/v4.27.0\/v2ray-linux-64.zip\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\n100   631  100   631    0     0    331      0  0:00:01  0:00:01 --:--:--   331\n  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0\n100 12.2M  100 12.2M    0     0   841k      0  0:00:14  0:00:14 --:--:-- 1899k\nDownloading verification file for V2Ray archive: https:\/\/github.com\/v2fly\/v2ray-core\/releases\/download\/v4.27.0\/v2ray-linux-64.zip.dgst\n  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current\n                                 Dload  Upload   Total   Spent    Left  Speed\n  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\n  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0\n100   636  100   636    0     0    294      0  0:00:02  0:00:02 --:--:--   295\n  0     0    0     0    0     0      0      0 --:--:--  0:00:02 --:--:--     0\n100   590  100   590    0     0    133      0  0:00:04  0:00:04 --:--:--   282\nReading package lists... Done\nBuilding dependency tree       \nReading state information... Done\nSuggested packages:\n  zip\nThe following NEW packages will be installed:\n  unzip\n0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.\nNeed to get 172 kB of archives.\nAfter this operation, 580 kB of additional disk space will be used.\nGet:1 http:\/\/mirrors.163.com\/debian buster\/main amd64 unzip amd64 6.0-23+deb10u1 &#91;172 kB]\nFetched 172 kB in 1s (173 kB\/s)   \nSelecting previously unselected package unzip.\n(Reading database ... 31383 files and directories currently installed.)\nPreparing to unpack ...\/unzip_6.0-23+deb10u1_amd64.deb ...\nUnpacking unzip (6.0-23+deb10u1) ...\nSetting up unzip (6.0-23+deb10u1) ...\nProcessing triggers for mime-support (3.62) ...\nProcessing triggers for man-db (2.8.5-2) ...\ninfo: unzip is installed.\ninfo: Extract the V2Ray package to \/tmp\/tmp.vk9AF2EqKA\/ and prepare it for installation.\ninstalled: \/usr\/local\/bin\/v2ray\ninstalled: \/usr\/local\/bin\/v2ctl\ninstalled: \/usr\/local\/share\/v2ray\/geoip.dat\ninstalled: \/usr\/local\/share\/v2ray\/geosite.dat\ninstalled: \/usr\/local\/etc\/v2ray\/00_log.json\ninstalled: \/usr\/local\/etc\/v2ray\/01_api.json\ninstalled: \/usr\/local\/etc\/v2ray\/02_dns.json\ninstalled: \/usr\/local\/etc\/v2ray\/03_routing.json\ninstalled: \/usr\/local\/etc\/v2ray\/04_policy.json\ninstalled: \/usr\/local\/etc\/v2ray\/05_inbounds.json\ninstalled: \/usr\/local\/etc\/v2ray\/06_outbounds.json\ninstalled: \/usr\/local\/etc\/v2ray\/07_transport.json\ninstalled: \/usr\/local\/etc\/v2ray\/08_stats.json\ninstalled: \/usr\/local\/etc\/v2ray\/09_reverse.json\ninstalled: \/var\/log\/v2ray\/\ninstalled: \/var\/log\/v2ray\/access.log\ninstalled: \/var\/log\/v2ray\/error.log\ninstalled: \/etc\/systemd\/system\/v2ray.service\ninstalled: \/etc\/systemd\/system\/v2ray@.service\nremoved: \/tmp\/tmp.vk9AF2EqKA\/\ninfo: V2Ray v4.27.0 is installed.\nYou may need to execute a command to remove dependent software: apt remove curl unzip\nPlease execute the command: systemctl enable v2ray; systemctl start v2ray\n\u770b\u5230\u7c7b\u4f3c\u4e8e\u8fd9\u6837\u7684\u63d0\u793a\u5c31\u7b97\u5b89\u88c5\u6210\u529f\u4e86\u3002\u5982\u679c\u5b89\u88c5\u4e0d\u6210\u529f\u811a\u672c\u4f1a\u6709\u63d0\u793a\u8bed\u53e5\uff0c\u8fd9\u4e2a\u65f6\u5019\u4f60\u5e94\u5f53\u6309\u7167\u63d0\u793a\u9664\u9519\uff0c\u9664\u9519\u540e\u518d\u91cd\u65b0\u6267\u884c\u4e00\u904d\u811a\u672c\u5b89\u88c5 V2Ray\u3002\u5bf9\u4e8e\u9519\u8bef\u63d0\u793a\u5982\u679c\u770b\u4e0d\u61c2\uff0c\u4f7f\u7528\u7ffb\u8bd1\u8f6f\u4ef6\u7ffb\u8bd1\u4e00\u4e0b\u5c31\u597d\u3002\n\n#\u8fd0\u884c\n\u5b89\u88c5\u5b8c\u4e4b\u540e\uff0c\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u542f\u52a8 V2Ray:\n\n$ systemctl start v2ray\n\u5728\u9996\u6b21\u5b89\u88c5\u5b8c\u6210\u4e4b\u540e\uff0cV2Ray \u4e0d\u4f1a\u81ea\u52a8\u542f\u52a8\uff0c\u9700\u8981\u624b\u52a8\u8fd0\u884c\u4e0a\u8ff0\u542f\u52a8\u547d\u4ee4\u3002\n\n\u8bbe\u7f6e\u5f00\u673a\u81ea\u542f\u52a8 V2Ray:\n\n$ systemctl enable v2ray\n\u63a5\u4e0b\u6765\u770b\u770b V2ray \u662f\u4e0d\u662f\u771f\u7684\u8fd0\u884c\u8d77\u6765\u4e86:\n\n$ systemctl status v2ray\n\u25cf v2ray.service - V2Ray Service\n   Loaded: loaded (\/etc\/systemd\/system\/v2ray.service; disabled; vendor preset: enabled)\n   Active: active (running) since Sun 2020-08-16 23:17:13 CST; 41min ago\n Main PID: 1984 (v2ray)\n    Tasks: 6 (limit: 2359)\n   Memory: 6.9M\n   CGroup: \/system.slice\/v2ray.service\n           \u2514\u25001984 \/usr\/local\/bin\/v2ray -confdir \/usr\/local\/etc\/v2ray\/\n\nAug 16 23:17:13 debian v2ray&#91;1984]: v2ctl> Read config:  \/usr\/local\/etc\/v2ray\/01_api.json\nAug 16 23:17:13 debian v2ray&#91;1984]: v2ctl> Read config:  \/usr\/local\/etc\/v2ray\/02_dns.json\nAug 16 23:17:13 debian v2ray&#91;1984]: v2ctl> Read config:  \/usr\/local\/etc\/v2ray\/03_routing.json\nAug 16 23:17:13 debian v2ray&#91;1984]: v2ctl> Read config:  \/usr\/local\/etc\/v2ray\/04_policy.json\nAug 16 23:17:13 debian v2ray&#91;1984]: v2ctl> Read config:  \/usr\/local\/etc\/v2ray\/05_inbounds.json\nAug 16 23:17:13 debian v2ray&#91;1984]: v2ctl> Read config:  \/usr\/local\/etc\/v2ray\/06_outbounds.json\nAug 16 23:17:13 debian v2ray&#91;1984]: v2ctl> Read config:  \/usr\/local\/etc\/v2ray\/07_transport.json\nAug 16 23:17:13 debian v2ray&#91;1984]: v2ctl> Read config:  \/usr\/local\/etc\/v2ray\/08_stats.json\nAug 16 23:17:13 debian v2ray&#91;1984]: v2ctl> Read config:  \/usr\/local\/etc\/v2ray\/09_reverse.json\nAug 16 23:17:13 debian v2ray&#91;1984]: 2020\/08\/16 23:17:13 &#91;Warning] v2ray.com\/core: V2Ray 4.27.0 start\nlines 1-19\/19 (END)\n\u770b\u5230\u7c7b\u4f3c\u4e8e\u8fd9\u6837\u7684\u63d0\u793a\u5c31\u7b97\u542f\u52a8\u6210\u529f\u4e86\u3002\n\n\u4f46\u662f\u7531\u4e8e\u6b64\u65f6\u4f60\u8fd8\u6ca1\u6709\u4e3a V2ray \u914d\u7f6e\uff0c\u6240\u4ee5\u54b1\u4eec\u8fd8\u662f\u628a\u5b83\u5173\u6389\u5427\uff1a\n\n$ systemctl stop v2ray\n\u5bf9\u4e8e\u5b89\u88c5\u811a\u672c\uff0c\u8fd8\u6709\u66f4\u591a\u7528\u6cd5\uff0c\u5728\u6b64\u4e0d\u591a\u8bf4\u4e86\uff0c\u53ef\u4ee5\u6267\u884c bash install-release.sh -h \u770b\u5e2e\u52a9\u3002\n\n\u5173\u4e8e V2ray \u914d\u7f6e\uff0c\u8bf7\u53c2\u8003 v2ray-examples (opens new window)\u5185\u7684\u793a\u4f8b\u3002\n\n#\u5347\u7ea7\u66f4\u65b0\n\u5728 VPS\uff0c\u91cd\u65b0\u6267\u884c\u4e00\u904d\u5b89\u88c5\u811a\u672c\u5c31\u53ef\u4ee5\u66f4\u65b0\u4e86\uff0c\u5728\u66f4\u65b0\u8fc7\u7a0b\u4e2d\u4f1a\u81ea\u52a8\u91cd\u542f V2Ray\uff0c\u914d\u7f6e\u6587\u4ef6\u4fdd\u6301\u4e0d\u53d8\u3002\n\n$ bash install-release.sh<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u53c2\u8003\u94fe\u63a5  <a href=\"https:\/\/guide.v2fly.org\/prep\/install.html#%E8%BF%90%E8%A1%8C\">\u5b89\u88c5 | \u65b0 V2Ray \u767d\u8bdd\u6587\u6307\u5357 (v2fly.org)<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u53c2\u8003\u94fe\u63a5 \u5b89\u88c5 | \u65b0 V2Ray \u767d\u8bdd\u6587\u6307\u5357 (v2fly.org)<\/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-1320","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/minglelu.cn\/index.php\/wp-json\/wp\/v2\/posts\/1320","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/minglelu.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/minglelu.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/minglelu.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/minglelu.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1320"}],"version-history":[{"count":2,"href":"https:\/\/minglelu.cn\/index.php\/wp-json\/wp\/v2\/posts\/1320\/revisions"}],"predecessor-version":[{"id":1322,"href":"https:\/\/minglelu.cn\/index.php\/wp-json\/wp\/v2\/posts\/1320\/revisions\/1322"}],"wp:attachment":[{"href":"https:\/\/minglelu.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1320"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/minglelu.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1320"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/minglelu.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1320"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}