{"id":214339,"date":"2021-04-01T10:22:25","date_gmt":"2021-04-01T02:22:25","guid":{"rendered":"https:\/\/gulass.cn\/?p=214339"},"modified":"2021-03-22T10:27:54","modified_gmt":"2021-03-22T02:27:54","slug":"linux-cntlm","status":"publish","type":"post","link":"https:\/\/gulass.cn\/linux-cntlm.html","title":{"rendered":"\u5728Linux\u4e0b\u5b89\u88c5\u914d\u7f6eCntlm\u4ee3\u7406\u6559\u7a0b"},"content":{"rendered":"\n\n\n
\u5bfc\u8bfb<\/td>\n\u6709\u4e9b\u516c\u53f8\uff0c\u4e0a\u7f51\u6709\u9650\u5236\uff0c\u5374\u6ca1\u6709\u7edf\u4e00\u914d\u7f6e\u7f51\u5173\u548c\u8def\u7531\uff0c\u53ea\u662f\u63d0\u4f9b\u4e86\u4e0a\u5916\u7f51\u7684\u4ee3\u7406\u3002 IT\u8bbe\u65bd\u7684\u4e0d\u5b8c\u5584\uff0c\u53ea\u80fd\u8ba9\u5458\u5de5\u81ea\u5df1\u60f3\u529e\u6cd5\u3002 \u5f53\u7136\uff0c\u4e5f\u6709\u4e9b\u60c5\u51b5\u662f\u7279\u6b8a\u7684\u7f51\u7edc\u7b56\u7565\u4e0e\u6743\u9650\u7ba1\u7406\u6240\u81f4\u3002<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

\"\"<\/p>\n

Cntlm\u662f\u4e00\u4e2aHTTP\u4e8c\u7ea7\u4ee3\u7406\u8f6f\u4ef6\u3002 \u5b83\u4e3b\u8981\u7684\u4f5c\u7528\uff0c\u662f\u5728\u80fd\u4ee3\u7406\u4e0a\u7f51\u7684\u524d\u63d0\u4e0b\uff0c\u7ed9\u8fd9\u4e2a\u4ee3\u7406\u518d\u505a\u4e00\u4e2a\u4ee3\u7406\uff0c\u63d0\u4f9b\u7ed9\u66f4\u591a\u7684\u4e0b\u7ea7\u7528\u6237\u3002 \u4e0b\u7ea7\u7528\u6237\u4e0d\u9700\u8981\u3001\u4e5f\u4e0d\u53ef\u80fd\u77e5\u9053\u4ee3\u7406\u7684\u8d26\u6237\u5bc6\u7801\uff0c\u8fd9\u6837\u65e2\u4fdd\u969c\u4e86\u5b89\u5168\u3001\u53c8\u5b9e\u73b0\u4e86\u65b9\u4fbf\u3002<\/p>\n

\u5b89\u88c5<\/strong><\/div>\n

\u4ee5Debian\u7cfb\u7684\u5b89\u88c5\u4e3a\u4f8b\uff1a<\/p>\n

\r\nsudo apt install cntlm\r\n<\/pre>\n

\u975eDebian\u7cfb\u7684\u5b89\u88c5\uff0c\u4e5f\u662f\u7c7b\u4f3c\u7684\u5f62\u5f0f\u3002 Cntlm\u662f\u4e00\u4e2a\u5f88\u8001\u7684\u8f6f\u4ef6\uff0c\u5728\u5404\u5927Linux\u53d1\u884c\u7248\u90fd\u6709\u53d1\u5e03\u3002 \u751a\u81f3\uff0c\u8fdeWindows\u4e0b\u4e5f\u6709\u53d1\u5e03\uff0c\u53ef\u4ee5\u901a\u8fc7choco\u5b89\u88c5\u3002<\/p>\n

\r\nchoco install cntlm\r\n<\/pre>\n

\u4e0b\u9762\u7684\u4ecb\u7ecd\u4ee5Linux\u4e3a\u4f8b\u3002 Windows\u4e0b\u7684\u914d\u7f6e\uff0c\u548cLinux\u5927\u540c\u5c0f\u5f02\uff0c\u53ea\u662f\u6587\u4ef6\u4f4d\u7f6e\u4e0d\u540c\u3002<\/p>\n

\u914d\u7f6e<\/strong><\/div>\n

Cntlm\u5b89\u88c5\u540e\uff0c\u5728\/etc\/cntlm.conf\u5c31\u6709\u4e00\u4efd\u9ed8\u8ba4\u914d\u7f6e\u3002 \u5982\u679c\u9700\u8981\u5728\u7ebf\u67e5\u770b\u914d\u7f6e\uff0c\u53ef\u4ee5\u53c2\u8003cntlm.conf\u3002<\/p>\n

\u4fee\u6539cntlm.conf<\/strong><\/div>\n

\u4ee5\u4e0b\u914d\u7f6e\uff0c\u51e0\u4e4e\u662f\/etc\/cntlm.conf\u7684\u6700\u7b80\u914d\u7f6e\u3002<\/p>\n

\r\nUsername    USERNAME\r\nDomain      COMPANY_DOMAIN\r\nPassword    ********\r\n\r\nProxy       proxy.company.com:8080\r\nProxy       proxy2.company.com:8080\r\n\r\nNoProxy     localhost, 127.0.0.*, 10.*, 192.168.*, .company.com\r\n\r\nListen      3128\r\n<\/pre>\n

\u6ce8\u610f\uff1a\u5176\u4e2dUSERNAME\u3001proxy.company.com:8080\u7b49\uff0c\u5e94\u8be5\u6362\u6210\u81ea\u5df1\u7684\u573a\u666f\u9002\u7528\u7684\u503c\u3002 \u6b64\u5916\uff0c\u5982\u679c\u4f7f\u7528\u4e0b\u4e00\u8282\u3010\u83b7\u53d6Auth\u3011\u7684\u624b\u6bb5\uff0cPassword\u914d\u7f6e\u53ef\u7701\u7565\u3002<\/p>\n

\u8fd9\u4e2a\u914d\u7f6e\uff0c\u4ec5\u80fd\u8ba9\u672c\u673a\u8bbf\u95ee\u3002 \u5982\u679c\u8981\u5141\u8bb8localhost\u4ee5\u5916\u7684\u673a\u5668\u8bbf\u95ee\uff0c\u5219\u9700\u8981\u518d\u6dfb\u52a0Gateway yes\u3002<\/p>\n

\r\nGateway yes\r\n<\/pre>\n

\u5982\u679c\u9700\u8981\u9650\u5236\u5916\u90e8\u8bbf\u95ee\uff0c\u53ef\u4ee5\u8bbe\u7f6e\u9ed1\uff08Deny\uff09\u767d\uff08Allow\uff09\u540d\u5355\u3002<\/p>\n

\r\nAllow       127.0.0.1\r\nDeny        0\/0\r\n<\/pre>\n
\u83b7\u53d6Auth<\/strong><\/div>\n

\u4ee5\u4e0a\u914d\u7f6e\u4fee\u6539\u5b8c\u6210\u540e\uff0c\u9700\u8981\u91cd\u8f7d\u6216\u91cd\u542fcntlm\u3002 \u5177\u4f53\u65b9\u6cd5\u89c1\u91cd\u8f7d\u6216\u91cd\u542f\u3002<\/p>\n

\r\n$ sudo cntlm -vc \/etc\/cntlm.conf -M http:\/\/baidu.com\r\nsection: global, Username = 'USERNAME'\r\nsection: global, Domain = 'COMPANY_DOMAIN'\r\nsection: global, Proxy = 'proxy.company.com:8080'\r\nsection: global, Proxy = 'proxy2.company.com:8080'\r\nsection: global, NoProxy = 'localhost, 127.0.0.*, 10.*, 192.168.*, .company.com'\r\nsection: global, Listen = '3128'\r\n...\r\nHEAD: HTTP\/1.1 200 OK\r\nOK (HTTP code: 200)\r\n----------------------------[ Profile  1 ]------\r\nAuth            NTLM\r\nPassNT          7FA051B4B85F0E7EEBB24D3CD73E52B0\r\nPassLM          23A1E1A7276E84EA4846D4C9FF957C35\r\n------------------------------------------------\r\ncntlm: Terminating with 0 active threads\r\n<\/pre>\n
\u6dfb\u52a0Auth\u5230\u914d\u7f6e<\/strong><\/div>\n

\u6dfb\u52a0\u4ee5\u4e0b\u5185\u5bb9\u5230\u521a\u624d\u4fee\u6539\u8fc7\u7684\/etc\/cntlm.conf\uff1a<\/p>\n

\r\nAuth            NTLM\r\nPassNT          7FA051B4B85F0E7EEBB24D3CD73E52B9\r\nPassLM          23A1E1A7276E84EA4846D4C9FF957C31\r\n<\/pre>\n
\u91cd\u8f7d\u6216\u91cd\u542f<\/strong><\/div>\n

\u5728\u4f7f\u7528\u5305\u7ba1\u7406\u5668\u5b89\u88c5\u7684\u60c5\u51b5\u4e0b\uff0cCntlm\u9ed8\u8ba4\u7531systemd\u6765\u5b88\u62a4\uff0c\u5f00\u673a\u81ea\u542f\u3002<\/p>\n

\u4fee\u6539\u914d\u7f6e\u540e\uff0c\u91cd\u8f7d\u5373\u53ef\u751f\u6548\uff1a<\/p>\n

\r\nsudo systemctl reload cntlm\r\n<\/pre>\n

\u82e5\u4ecd\u672a\u751f\u6548\uff0c\u53ef\u4ee5\u5c1d\u8bd5\u91cd\u542f\uff1a<\/p>\n

\r\nsudo systemctl restart cntlm<\/pre>\n","protected":false},"excerpt":{"rendered":"

Cntlm\u662f\u4e00\u4e2aHTTP\u4e8c\u7ea7\u4ee3\u7406\u8f6f\u4ef6\u3002 \u5b83\u4e3b\u8981\u7684\u4f5c\u7528\uff0c\u662f\u5728\u80fd\u4ee3\u7406\u4e0a\u7f51\u7684\u524d\u63d0\u4e0b\uff0c\u7ed9\u8fd9\u4e2a\u4ee3\u7406\u518d\u505a\u4e00\u4e2a\u4ee3\u7406\uff0c\u63d0\u4f9b\u7ed9\u66f4 […]<\/p>\n","protected":false},"author":668,"featured_media":214341,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-214339","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/214339","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/users\/668"}],"replies":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/comments?post=214339"}],"version-history":[{"count":2,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/214339\/revisions"}],"predecessor-version":[{"id":214343,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/posts\/214339\/revisions\/214343"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media\/214341"}],"wp:attachment":[{"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/media?parent=214339"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/categories?post=214339"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gulass.cn\/wp-json\/wp\/v2\/tags?post=214339"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}