$ sudo dnf install squid -y<\/pre>\nsquid \u914d\u7f6e\u6587\u4ef6\u975e\u5e38\u5e9e\u5927\uff0c\u4f46\u662f\u6211\u4eec\u53ea\u9700\u8981\u914d\u7f6e\u5176\u4e2d\u4e00\u4e9b\u3002Squid \u4f7f\u7528\u8bbf\u95ee\u63a7\u5236\u5217\u8868\u6765\u7ba1\u7406\u8fde\u63a5\u3002<\/p>\n
\u7f16\u8f91 \/etc\/squid\/squid.conf\u00a0\u6587\u4ef6\uff0c\u786e\u4fdd\u4f60\u6709\u4e0b\u9762\u89e3\u91ca\u7684\u4e24\u884c\u3002<\/p>\n
\u9996\u5148\uff0c\u6307\u5b9a\u4f60\u7684\u672c\u5730 IP \u7f51\u7edc\u3002\u9ed8\u8ba4\u914d\u7f6e\u6587\u4ef6\u5df2\u7ecf\u5217\u51fa\u4e86\u6700\u5e38\u7528\u7684\uff0c\u4f46\u662f\u5982\u679c\u6ca1\u6709\uff0c\u4f60\u9700\u8981\u6dfb\u52a0\u4f60\u7684\u914d\u7f6e\u3002\u4f8b\u5982\uff0c\u5982\u679c\u4f60\u7684\u672c\u5730 IP \u7f51\u7edc\u8303\u56f4\u662f 192.168.1.X\uff0c\u90a3\u4e48\u8fd9\u884c\u4f1a\u662f\u8fd9\u6837\uff1a<\/p>\n
acl localnet src 192.168.1.0\/24<\/pre>\n\u63a5\u4e0b\u6765\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u884c\uff0c\u5c06 SSH \u7aef\u53e3\u6dfb\u52a0\u4e3a\u5b89\u5168\u7aef\u53e3\uff1a<\/p>\n
acl Safe_ports port 22<\/pre>\n\u4fdd\u5b58\u8be5\u6587\u4ef6\u3002\u73b0\u5728\u542f\u7528\u5e76\u91cd\u542f squid \u4ee3\u7406\u670d\u52a1\uff1a<\/p>\n
$ sudo systemctl enable squid\r\n$ sudo systemctl restart squid<\/pre>\nsquid \u4ee3\u7406\u9ed8\u8ba4\u76d1\u542c 3128 \u7aef\u53e3\u3002\u914d\u7f6e firewalld \u5141\u8bb8\u6b64\u670d\u52a1\uff1a<\/p>\n
$ sudo firewall-cmd --add-service=squid --perm\r\n$ sudo firewall-cmd --reload<\/pre>\n\u6d4b\u8bd5 ssh \u4ee3\u7406\u8fde\u63a5<\/strong><\/div>\n\u8981\u901a\u8fc7 ssh \u4ee3\u7406\u670d\u52a1\u5668\u8fde\u63a5\u5230\u670d\u52a1\u5668\uff0c\u6211\u4eec\u5c06\u4f7f\u7528\u00a0netcat\u3002<\/p>\n
\u5982\u679c\u5c1a\u672a\u5b89\u88c5 nmap-ncat\uff0c\u8bf7\u5b89\u88c5\u5b83\uff1a<\/p>\n
$ sudo dnf install nmap-ncat -y<\/pre>\n\u8fd9\u662f\u6807\u51c6 ssh \u8fde\u63a5\u793a\u4f8b\uff1a<\/p>\n
$ ssh user@example.com<\/pre>\n\u8fd9\u662f\u4f7f\u7528 squid \u4ee3\u7406\u670d\u52a1\u5668\u4f5c\u4e3a\u7f51\u5173\u8fde\u63a5\u5230\u8be5\u670d\u52a1\u5668\u7684\u65b9\u5f0f\u3002<\/p>\n
\u6b64\u793a\u4f8b\u5047\u5b9a squid \u4ee3\u7406\u670d\u52a1\u5668\u7684 IP \u5730\u5740\u4e3a 192.168.1.63\u3002\u4f60\u8fd8\u53ef\u4ee5\u4f7f\u7528 squid \u4ee3\u7406\u670d\u52a1\u5668\u7684\u4e3b\u673a\u540d\u6216 FQDN\uff1a<\/p>\n
$ ssh user@example.com -o \"ProxyCommand nc --proxy 192.168.1.63:3128 %h %p\"<\/pre>\n\u4ee5\u4e0b\u662f\u8fd9\u4e9b\u9009\u9879\u7684\u542b\u4e49\uff1a<\/p>\n
\n- ProxyCommand\u00a0\u2013 \u544a\u8bc9 ssh \u4f7f\u7528\u4ee3\u7406\u547d\u4ee4\u3002<\/li>\n
- nc\u00a0\u2013 \u7528\u4e8e\u5efa\u7acb\u4e0e\u4ee3\u7406\u670d\u52a1\u5668\u8fde\u63a5\u7684\u547d\u4ee4\u3002\u8fd9\u662f netcat \u547d\u4ee4\u3002<\/li>\n
- %h\u00a0\u2013 \u4ee3\u7406\u670d\u52a1\u5668\u7684\u4e3b\u673a\u540d\u6216 IP \u5730\u5740\u7684\u5360\u4f4d\u7b26\u3002<\/li>\n
- %p\u00a0\u2013 \u4ee3\u7406\u670d\u52a1\u5668\u7aef\u53e3\u53f7\u7684\u5360\u4f4d\u7b26\u3002<\/li>\n<\/ul>\n
\u6709\u5f88\u591a\u65b9\u6cd5\u53ef\u4ee5\u914d\u7f6e SSH \u4ee3\u7406\u670d\u52a1\u5668\uff0c\u4f46\u8fd9\u662f\u5165\u95e8\u200b\u200b\u7684\u7b80\u5355\u65b9\u6cd5\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"
Squid\u00a0\u662f\u63d0\u4f9b\u7f13\u5b58\u548c\u4ee3\u7406\u670d\u52a1\u7684\u5168\u529f\u80fd\u4ee3\u7406\u670d\u52a1\u5668\u5e94\u7528\u3002\u5b83\u901a\u5e38\u7528\u4e8e\u5728\u6d4f\u89c8\u8fc7\u7a0b\u4e2d\u91cd\u7528\u548c\u7f13\u5b58\u4ee5\u524d\u8bf7\u6c42\u7684\u7f51\u9875\u6765\u5e2e\u52a9\u7f29 […]<\/p>\n","protected":false},"author":323,"featured_media":7104,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-197944","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/197944","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/323"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=197944"}],"version-history":[{"count":3,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/197944\/revisions"}],"predecessor-version":[{"id":197948,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/197944\/revisions\/197948"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/7104"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=197944"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=197944"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=197944"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}