{"id":1282,"date":"2022-07-04T22:02:51","date_gmt":"2022-07-04T14:02:51","guid":{"rendered":"https:\/\/yowlab.idv.tw\/wordpress\/?p=1282"},"modified":"2022-07-04T22:09:24","modified_gmt":"2022-07-04T14:09:24","slug":"%e9%9a%b1%e5%bd%a2%e7%9a%84%e8%b7%b3%e6%9d%bf-%e8%87%a8%e6%99%82%e7%9a%84-vpn-sshuttle","status":"publish","type":"post","link":"https:\/\/yowlab.idv.tw\/wordpress\/?p=1282","title":{"rendered":"\u96b1\u5f62\u7684\u8df3\u677f \/ \u81e8\u6642\u7684 vpn &#8212;sshuttle"},"content":{"rendered":"<p>\u56e0\u61c9\u8cc7\u5b89\u7de3\u6545\uff08\u7db2\u8def\u4e0a\u7684\u58de\u4eba\u592a\u591a\uff09\uff0c\u6240\u4ee5\u55ae\u4f4d\u88e1\u5f88\u591a\u6a5f\u5668\u90fd\u85cf\u5230\u9632\u706b\u7246\u5f8c\u9762\uff0c\u9664\u975e\u7279\u5225\u958b\u5c0d\u5916\u9023\u63a5\u57e0\uff0c\u5426\u5247\u55ae\u4f4d\u5916\u6a5f\u5668\u662f\u7121\u6cd5\u76f4\u63a5\u5f9e\u5916\u9762\u9023\u63a5\u9032\u4f86\u3002\u53c8\uff0c\u73fe\u5728\u6700\u5e38\u898b\u7684\u5b89\u5168\u6027\u4f5c\u6cd5\u4fbf\u662f\u6a5f\u5668\u4e00\u5b9a\u8981\u5728\u67d0\u9650\u5b9a\u7684\u7db2\u57df\u5167\uff0c\u624d\u80fd\u57f7\u884c\u67d0\u5de5\u4f5c\uff0c\u6216\u662f\u4f7f\u7528\u67d0\u8cc7\u6e90\u3002<\/p>\n<p>\u4f46\u73fe\u5be6\u7e3d\u662f\u6703\u6709\u4f8b\u5916\uff0c\u6703\u6709\u7121\u6cd5\u5be6\u969b\u5728\u9650\u5b9a\u7684\u7db2\u57df\u88e1\uff0c\u4f46\u53c8\u6709\u5be6\u969b\u9023\u63a5\u7684\u77ed\u66ab\u9700\u6c42\u6642\uff0c\u9762\u5c0d\u6b64\u554f\u984c\uff0c\u4e0d\u5c11\u55ae\u4f4d\u5247\u6703\u4f7f\u7528\u67b6\u8a2d vpn \u670d\u52d9\u4f86\u56e0\u61c9\u3002<\/p>\n<p>\u4e0d\u904e\uff0c\u82e5\u4e0d\u60f3\u56e0\u70ba\u81e8\u6642\u77ed\u66ab\u7684\u9700\u6c42\u800c\u5927\u8cbb\u5468\u7ae0\u7684\u67b6\u8a2d vpn \u670d\u52d9\u6642\uff0c\u53ef\u4ee5\u5229\u7528 sshuttle \u4f86\u505a\u500b\u81e8\u6642\u901a\u9053\uff0c\u8b93\u81ea\u5df1\u7684\u6a5f\u5668\u66ab\u6642\u6210\u70ba\u8a72\u7db2\u57df\u5e95\u4e0b\u4e3b\u6a5f\u7684\u4e00\u54e1\u3002 <\/p>\n<style type=\"text\/css\">\n    li.present01 {line-height:1.5em; background-color:#F5E5C9; padding:5px; border-radius:10px; font-weight:bold; margin:5px;}\n    li.present02 {line-height:1.5em; background-color:#D1EC87; padding:5px; border-radius:10px; font-weight:bold; margin:5px;}<\/p>\n<p>    ul.none {list-style-type:none;line-height:1.5em; padding:10px;}\n    ol.lower-roman {list-style-type:lower-roman;}\n    ul.note {line-height:1.5em; padding:2px; font-weight:bold; font-size:0.9em;}\n    .highlight01 {font-weight:bold; line-height:1.5em; background-color:#e7f49c; padding:3px 10px; border:2px soild; border-radius:10px;}\n    .highlight02 {font-weight:bold; line-height:1.5em; background-color:#F2F26B; padding:3px 10px; border:2px soild; border-radius:10px;}\n    .highlight03 {font-weight:bold; line-height:1.5em; background-color:#DFAB66; padding:3px 10px; border:2px soild; border-radius:10px;}\n    .box01 {margin: 5px; border:1px #19130B solid; border-radius:5px; padding:10px;}\n    .box02 {margin: 5px; font-weight:bold; line-height:1.5em; padding:10px; border:1px #19130B solid; border-radius:5px; float: left;}\n    h3 {border:2px #000 solid; border-width:0px 0px 1px 0px; padding-width:0px 0px 3px 0px;}<\/p>\n<\/style>\n<p>\u6574\u500b\u6982\u5ff5\u5982\u4e0b\u5716\uff1a<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/sshuttle01.png\" alt=\"\" width=\"1058\" height=\"595\" class=\"alignnone size-full wp-image-1284\" srcset=\"https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/sshuttle01.png 1058w, https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/sshuttle01-350x197.png 350w, https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/sshuttle01-1024x576.png 1024w, https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/sshuttle01-768x432.png 768w\" sizes=\"auto, (max-width: 1058px) 100vw, 1058px\" \/><\/p>\n<p>\u4e3b\u6a5f\uff08192.168.0.100\uff09\u4f4d\u5728 192.192.0.0 \u6b64\u7db2\u57df\u4e4b\u5916\uff0c\u900f\u904e sshuttle \u9023\u63a5 192.192.0.100 \u9019\u90e8\u4e3b\u6a5f\u5f8c\uff0c\u4fbf\u96b1\u8eab\u5230 192.192.0.100 \u4e3b\u6a5f\u88e1\u9762\uff0c\u6240\u6709\u7684\u5c0d\u5916\u9023\u7dda\u9700\u6c42\u5247\u5168\u90e8\u90fd\u4ee5 192.192.0.100 \u9019\u90e8\u4e3b\u6a5f\u7684\u540d\u7fa9\u5c0d\u5916\u767c\u51fa\uff0c\u9019\u5c31\u597d\u50cf\u8b8a\u6210\u4e86 192.192.0.0 \u6b64\u7db2\u57df\u88e1\u9762\u7684\u4e3b\u6a5f\u7684\u4e00\u54e1\u4e86\u3002<\/p>\n<p>sshuttle \u5b98\u7db2\u8868\u793a\u76ee\u524d\u53ea\u652f\u63f4 Linux, FreeBSD, \u6216 MacOS \u7b49\u4f5c\u696d\u7cfb\u7d71\uff0c\u800c\u6211\u500b\u4eba\u8a8d\u70ba\u5176\u5be6\u53ea\u8981\u80fd\u8dd1\u300cssh + python\u300d\u4fbf\u53ef\u3002\u56e0\u70ba sshuttle \u662f\u5960\u57fa\u5728 ssh \u670d\u52d9\u4e0a\u7531 python \u5beb\u6210\u7684\u5c0f\u7a0b\u5f0f\uff0c\u53ea\u9700\u8981 client \u7aef\u80fd\u57f7\u884c\u6b64\u7a0b\u5f0f\uff0c\u518d\u7531 server\u7aef\u958b\u555f ssh \u670d\u52d9\u4e26\u5c0d\u5916\u958b\u555f\u9023\u63a5\u57e0\uff0c\u4fbf\u53ef\u4ee5\u9054\u6210\uff01<\/p>\n<p>\u81f3\u65bc\u70ba\u4ec0\u9ebc ssh server \u4e0a\u53ea\u9700\u8981 python \u800c\u4e0d\u7528\u88dd sshuttle \u5462\uff1f\u56e0\u70ba sshuttle \u5728\u57f7\u884c\u5f8c\uff0c\u6703\u81ea\u52d5\u5c07 client \u88e1\u7684 sshuttle \u7684\u6a94\u6848\u4e0a\u50b3\uff0c\u4e26\u4e14\u57f7\u884c\uff0c\u9019\u6a23\u4e0d\u4f46\u7701\u9ebb\u7169\uff0c\u800c\u4e14\u4e5f\u4e0d\u6703\u6709\u7248\u672c\u4e0d\u540c\u7684\u554f\u984c\u3002\uff08\u6b64\u6bb5\u662f\u4f9d\u64da\u300c<a href=\"https:\/\/louie023.wordpress.com\/2013\/07\/30\/%E7%AA%AE%E4%BA%BA%E7%9A%84-vpn-sshuttle-%E4%BB%8B%E7%B4%B9\/\" rel=\"noopener\" target=\"_blank\">\u7aae\u4eba\u7684 vpn \u2013 sshuttle \u4ecb\u7d39<\/a>\u300d\u7684\u8aaa\u6cd5\uff09<\/p>\n<p>&nbsp;<\/p>\n<h3>\u53d6\u5f97\u8207\u5b89\u88dd<\/h3>\n<p>sshuttle \u53ef\u76f4\u63a5\u5728 github \u4e2d\u53d6\u5f97\uff0c <a href=\"https:\/\/github.com\/sshuttle\/sshuttle\" rel=\"noopener\" target=\"_blank\">https:\/\/github.com\/sshuttle\/sshuttle<\/a>\u3002\u4e5f\u53ef\u4ee5<span class=\"highlight01\">\u76f4\u63a5\u900f\u904e\u5404\u4f5c\u696d\u7cfb\u7d71\u7684\u5957\u4ef6\u7ba1\u7406\u7a0b\u5f0f\u5eab\uff0c\u76f4\u63a5\u53d6\u5f97\u5b89\u88dd<\/span>\u3002<\/p>\n<p>\u6211\u500b\u4eba\u662f\u5acc\u5957\u4ef6\u5eab\u88e1\u7684\u7a0b\u5f0f\u592a\u820a\uff0c\u66f4\u65b0\u592a\u6162\uff0c\u6240\u4ee5\u6211\u90fd\u76e1\u53ef\u80fd\u76f4\u63a5\u53bb\u5b98\u7db2\u4e0b\u8f09\u6700\u65b0\u7248\u56de\u4f86\u5b89\u88dd\u3002\u6574\u500b\u52d5\u4f5c\uff0c\u770b\u8d77\u4f86\u5f88\u5a01\uff0c\u5176\u5be6\u4e5f\u5c31\u4e09\u500b\u6b65\u9a5f\uff1a<\/p>\n<ol>\n<li  class=\"present01\">\u4e0b\u8f09<\/li>\n<p>            git clone https:\/\/github.com\/sshuttle\/sshuttle.git<\/p>\n<li  class=\"present01\">\u5b89\u88dd<\/li>\n<p>            cd sshuttle<br \/>\n            sudo .\/setup.py install<\/p>\n<li  class=\"present01\">\u6e05\u9664<\/li>\n<p>            cd ..<br \/>\n            sudo rm -Rf sshuttle\n<\/ol>\n<p>\u7279\u5225\u6ce8\u610f\u9ede\u6709\u4e8c\uff1a<\/p>\n<p>\u9996\u5148\uff0c\u5728\u5b89\u88dd\u5b8c\u6210\u4e4b\u5f8c\uff0c<span class=\"highlight01\">sshuttle \u6703\u88ab\u653e\u5728 \/usr\/local\/bin\/ \u76ee\u9304\u4e2d<\/span>\uff0c\u800c\u6b64\u6642\u8981<span class=\"highlight01\">\u6ce8\u610f client \u9019\u90e8\u6a5f\u5668 python \u7684\u57f7\u884c\u6a94\u7684\u4f4d\u7f6e\u5728\u54ea\u88e1<\/span>\uff0c\u4ee5\u6211\u7684\u6a5f\u5668\u4f86\u8aaa\uff0c\u662f\u653e\u5728 \/usr\/bin\/ \u6b64\u76ee\u9304\u5e95\u4e0b\uff0c\u4f46 sshuttle \u7a0b\u5f0f\u662f\u9810\u8a2d python \u653e\u5728 \/bin\/ \u5e95\u4e0b\uff0c\u6240\u4ee5\u8981\u5148\u53bb\u66f4\u6539 sshuttle \u3002\uff08\u4f7f\u7528\u6587\u5b57\u7de8\u8f2f\u5668\u4fbf\u53ef\uff0c\u4f8b\u5982\uff1avim \uff09<br \/>\n<img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/Screenshot_20220704_171645.png\" alt=\"\" width=\"1357\" height=\"451\" class=\"alignnone size-full wp-image-1288\" srcset=\"https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/Screenshot_20220704_171645.png 1357w, https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/Screenshot_20220704_171645-350x116.png 350w, https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/Screenshot_20220704_171645-1024x340.png 1024w, https:\/\/yowlab.idv.tw\/wordpress\/wp-content\/uploads\/2022\/07\/Screenshot_20220704_171645-768x255.png 768w\" sizes=\"auto, (max-width: 1357px) 100vw, 1357px\" \/><\/p>\n<p>\u5176\u6b21\uff0c\u8981\u6ce8\u610f client \u7aef\u8207 server \u7aef python \u7248\u672c\u865f\u78bc\u662f\u5426\u4e00\u81f4\uff0c\u82e5\u6709\u9023\u63a5\u5931\u6557\u7684\u72c0\u6cc1\uff0c\u53ef\u80fd\u662f\u5169\u7aef\u7248\u672c\u865f\u78bc\u4e0d\u540c\uff0c\u6b64\u6642\u8abf\u6574\u4e00\u4e0b\uff0c\u4fbf\u53ef\u4ee5\uff01\u820a\u7248\u6709\u6b64\u554f\u984c\uff0c\u4f46\u4e0d\u77e5\u6700\u65b0\u7248\u662f\u5426\u5df2\u4fee\u6389\u6b64\u554f\u984c\u3002<\/p>\n<p>&nbsp;<\/p>\n<h3>\u9023\u7dda<\/h3>\n<p>\u6700\u91cd\u8981\u7684\u9ede\uff0c\u9023\u7dda\u4e4b\u524d\uff0c\u8981\u5148\u78ba\u5b9a\u5728 192.192.0.100 \u9019\u90e8\u4e3b\u6a5f\u4e0a\uff0c\u8981\u6709\u53ef\u4ee5 ssh \u767b\u5165\u9032\u53bb\u7684\u5e33\u865f\uff0c\u82e5\u6c92\u6709\uff0c\u5c31\u6c92\u6709\u4ee5\u4e0b\u4e86\u3002<\/p>\n<p>\u57f7\u884c\u6642\uff0c\u53ef\u4ee5\u900f\u904e <span class=\"highlight01\">sshuttle &#8211;help<\/span> \u4e86\u89e3 sshuttle \u7684\u7528\u6cd5\u3002<\/p>\n<div class=\"box01\">\n\u9023\u7dda\u7bc4\u4f8b\uff1a<br \/>\n <span class=\"highlight01\"> sshuttle  -NHvr  (\u5e33\u865f)@192.192.0.100   192.168.0.0\/0 <\/span><\/p>\n<p>    \u8aaa\u660e\uff1a<\/p>\n<ul>\n<li>(\u5e33\u865f):\u53ef\u4ee5 ssh \u767b\u5165 192.192.0.100 \u7684\u771f\u5be6\u5e33\u865f\uff0c\u4e14\u5df2\u8a2d\u5b9a\u597d\u514d\u5bc6\u78bc\u767b\u5165\u3002<\/li>\n<li>-N\uff1a\u8b93 sshuttle \u81ea\u52d5\u5075\u6e2c\u6709\u54ea\u4e9b subnets \u8981\u8f49\u9001<\/li>\n<li>-H\uff1a\u81ea\u52d5\u6383\u63cf\u9060\u7aef ssh server \u7684 \/etc\/hosts\uff0c\u4e26\u66f4\u65b0\u672c\u5730 \/etc\/hosts\uff0c\u65b9\u4fbf\u5b58\u53d6\u4f3a\u670d\u5668\u4e4b\u985e\u7684<\/li>\n<li>-v \uff1a\u5c07\u57f7\u884c\u904e\u7a0b\u7d50\u679c\u986f\u793a\u51fa\u4f86<\/li>\n<li>-r\uff1a(\u2013remote) \u662f\u9060\u7aef\u7684 ssh server\uff0c\u672c\u4f8b\u4e2d\u7684 192.192.0.100<\/li>\n<li>192.168.0.0\/0\uff1a\u9023\u7dda Client \u7aef\u7684\u5b50\u7db2\u57df\uff0c\u8868\u793a\u4efb\u4f55\u5728\u6b64\u5b50\u7db2\u57df\u7684\u6a5f\u5668\uff0c\u53ea\u8981\u662f\u900f\u904e 192.168.0.100 \u9019\u90e8\u6a5f\u5668\u9023\u904e\u53bb\uff0c\u7d71\u7d71\u90fd\u6703\u8b8a\u6210\u62ab\u8457 192.192.0.100 \u5916\u8863\u7684\u6a5f\u5668\u3002<\/li>\n<\/ul>\n<\/div>\n<p>&nbsp;<\/p>\n<h3>\u53c3\u8003\u8cc7\u6e90\uff1a<\/h3>\n<ol>\n<li>sshuttle \u8f7b\u91cf\u7ea7\u5168\u5c40\u4ee3\u7406\u5de5\u5177<\/li>\n<p>           <a href=\"https:\/\/liwanggui.com\/posts\/sshuttle\/\" rel=\"noopener\" target=\"_blank\"> https:\/\/liwanggui.com\/posts\/sshuttle\/<\/a><\/p>\n<li>\u7aae\u4eba\u7684 vpn \u2013 sshuttle \u4ecb\u7d39<\/li>\n<p>            <a href=\"https:\/\/louie023.wordpress.com\/2013\/07\/30\/%E7%AA%AE%E4%BA%BA%E7%9A%84-vpn-sshuttle-%E4%BB%8B%E7%B4%B9\/\" rel=\"noopener\" target=\"_blank\">https:\/\/louie023.wordpress.com\/2013\/07\/30\/%E7%AA%AE%E4%BA%BA%E7%9A%84-vpn-sshuttle-%E4%BB%8B%E7%B4%B9\/<\/a>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u56e0\u61c9\u8cc7\u5b89\u7de3\u6545\uff08\u7db2\u8def\u4e0a\u7684\u58de\u4eba\u592a\u591a\uff09\uff0c\u6240\u4ee5\u55ae\u4f4d\u88e1\u5f88\u591a\u6a5f\u5668\u90fd\u85cf\u5230\u9632\u706b\u7246\u5f8c\u9762\uff0c\u9664\u975e\u7279\u5225\u958b\u5c0d <a class=\"more-link\" href=\"https:\/\/yowlab.idv.tw\/wordpress\/?p=1282\">Continue reading <span class=\"screen-reader-text\">  \u96b1\u5f62\u7684\u8df3\u677f \/ \u81e8\u6642\u7684 vpn &#8212;sshuttle<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[25,54,52,53],"class_list":["post-1282","post","type-post","status-publish","format-standard","hentry","category-3","tag-python","tag-ssh","tag-sshuttle","tag-vpn"],"_links":{"self":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1282","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1282"}],"version-history":[{"count":21,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1282\/revisions"}],"predecessor-version":[{"id":1305,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/1282\/revisions\/1305"}],"wp:attachment":[{"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1282"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1282"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/yowlab.idv.tw\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1282"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}