{"id":2734,"date":"2024-08-13T09:27:11","date_gmt":"2024-08-13T01:27:11","guid":{"rendered":"https:\/\/nj.transwarp.cn:8180\/?p=2734"},"modified":"2024-08-13T09:27:10","modified_gmt":"2024-08-13T01:27:10","slug":"%e4%ba%92%e4%bf%a1%e5%8f%82%e6%95%b0hadoop-security-auth_to_local%e8%af%a6%e8%a7%a3","status":"publish","type":"post","link":"https:\/\/kbwp.transwarp.cn\/?p=2734","title":{"rendered":"\u4e92\u4fe1\u53c2\u6570hadoop.security.auth_to_local\u8be6\u89e3"},"content":{"rendered":"<h3>\u6982\u8981\u63cf\u8ff0<\/h3>\n<hr \/>\n<p><strong>hadoop.security.auth_to_local\u8fd9\u4e2a\u53c2\u6570\u5e38\u5e38\u7528\u6765\u914d\u7f6e\u5982\u4f55\u5904\u7406\u6765\u81ea\u5176\u4ed6realm\u4e2d\u7684principal\uff0c\u5b9e\u73b0\u57fa\u672c\u7684\u5b89\u5168\u8fc7\u6ee4\u529f\u80fd\u3002<br \/>\n\u4f8b\u5982\uff0c\u60a8\u7684Hadoop realm\u662fTDH\uff0c\u60a8\u7684\u5408\u4f5c\u65b9realm\u662fCORP\uff0c\u7136\u540e\u6dfb\u52a0\u89c4\u5219\uff0c\u5c06\u5408\u4f5c\u65b9realm\u7684principal\u8f6c\u6362\u4e3a\u672c\u5730\u7528\u6237\u3002\u53ef\u4ee5\u901a\u8fc7\u4e0b\u9762\u8fd9\u6837\u7684\u914d\u7f6e\u5b9e\u73b0\u53ea\u4fe1\u4efb\u6765\u81earealm\u4e3aCORP\u7684principal<\/strong><\/p>\n<pre><code class=\"language-shell\"><property>\n    <name>hadoop.security.auth_to_local<\/name>\n    <value>\n        RULE:[1:$1@$0](.*@CORP)s\/@CORP\/\/\n        RULE:[2:$1@$0](.*@CORP)s\/@CORP\/\/ \n        DEFAULT\n    <\/value>\n<\/property><\/code><\/pre>\n<p><strong>\u8be5\u53c2\u6570\u5206\u4e3a\u4e0b\u97623\u6b65\u6765\u505a\u8fc7\u6ee4\u7b5b\u9009<\/strong><\/p>\n<ul>\n<li>\u521d\u59cbprincipal\u8f6c\u6362 &#8211; initial principal translation<\/li>\n<li>\u63a5\u53d7\u8fc7\u6ee4\u5668  &#8211; acceptance filter<\/li>\n<li>\u66ff\u6362\u547d\u4ee4 &#8211; substitution command<\/li>\n<\/ul>\n<p><strong>\u901a\u914d\u6837\u4f8b\uff08\u9002\u7528two-way trust\uff09\uff1a<\/strong><\/p>\n<pre><code class=\"language-shell\">RULE:[1:$1@$0](^.*@.*$)s\/^(.*)@.*$\/$1\/g \nRULE:[2:$1@$0](^.*@.*$)s\/^(.*)@.*$\/$1\/g \nDEFAULT<\/code><\/pre>\n<p><strong>\u5355\u5411\u4fe1\u4efb\u6837\u4f8b\uff08\u9002\u7528one-way trust\uff09\uff1a<\/strong><\/p>\n<pre><code class=\"language-shell\">RULE:[1:$1@$0](^.*@TDH$)s\/^(.*)@TDH$\/$1\/g \nRULE:[2:$1@$0](^.*@TDH$)s\/^(.*)@TDH$\/$1\/g \nDEFAULT<\/code><\/pre>\n<h3>\u8be6\u7ec6\u8bf4\u660e<\/h3>\n<hr \/>\n<h4>Step1: The initial principal translation<\/h4>\n<p><strong>\u6700\u521d\u7684principal\u8f6c\u6362\u7531\u4e00\u4e2a\u6570\u5b57\u548c\u66ff\u6362\u5b57\u7b26\u4e32\u7ec4\u6210\uff0c\u7b2c\u4e00\u4e2a\u6570\u5b57\u548cprincipal\u7684part\uff08\u4e0d\u5305\u62ecrealm\uff09\u76f8\u5339\u914d\uff0c\u66ff\u6362\u5b57\u7b26\u4e32\u5b9a\u4e49\u4e86principal\u6700\u521d\u7684\u4f20\u8f93\u65b9\u5f0f\u3002<\/strong><\/p>\n<p><strong>\u524d\u9762\u76841\/2\u4ee3\u8868\u90e8\u5206\u7684\u4e2a\u6570\uff0c\u6bd4\u5982kevin@TDH\u53ea\u80fd\u5339\u914d1\uff0chdfs\/node01@TDH\u53ea\u80fd\u5339\u914d2<\/strong><\/p>\n<ul>\n<li>$0\u5c06\u88abrealm\u66ff\u6362<\/li>\n<li>$1\u5c06\u88ab\u7b2c\u4e00\u4e2a\u90e8\u5206\u66ff\u6362<\/li>\n<li>$2\u5c06\u88ab\u7b2c\u4e8c\u4e2a\u90e8\u5206\u66ff\u6362<\/li>\n<\/ul>\n<p><strong>\u6709\u5173\u521d\u59cbprincipal\u8f6c\u6362\u7684\u4e00\u4e9b\u793a\u4f8b\uff0c\u8be6\u60c5\u53c2\u89c1\u4e0b\u8868\uff0c\u8f93\u51fa\u79f0\u4e3ainitial local name<\/strong><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/03\/image-1585389080174.png\" alt=\"file\" \/><\/p>\n<h4>Step2: The acceptance filter<\/h4>\n<p><strong>\u63a5\u53d7\u7b5b\u9009\u5668\u662f\u4e00\u4e2a\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u5982\u679cinitial local name(\u5373\u89c4\u5219\u7b2c\u4e00\u90e8\u5206\u7684output)\u5339\u914d\u6b63\u5219\u8868\u8fbe\u5f0f\uff0c\u7136\u540esubstitution\u547d\u4ee4\u5c06\u5728\u5b57\u7b26\u4e32\u4e0a\u8fd0\u884c\u3002<\/strong><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/03\/image-1585389129234.png\" alt=\"file\" \/><\/p>\n<h4>Step3: The substitution command<\/h4>\n<p><strong>\u66ff\u6362\u547d\u4ee4\u662f\u4e00\u4e2a\u5e26\u6709\u6b63\u5219\u8868\u8fbe\u5f0fpattern\u548c\u66ff\u6362\u5b57\u7b26\u4e32\u7684sed\u98ce\u683c\u7684\u66ff\u6362\u3002\u5339\u914d\u7684\u7ec4\u53ef\u4ee5\u901a\u8fc7\u5c06\u6b63\u5219\u8868\u8fbe\u5f0f\u7684\u4e00\u90e8\u5206\u62ec\u5728\u5706\u62ec\u53f7\u4e2d\uff0c\u5e76\u901a\u8fc7\u6570\u5b57(\u4f8b\u5982\uff0c\\1)\u5728\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u5f15\u7528\u6765\u5305\u542b\u3002\u7ec4\u53f7\u7531\u6b63\u5219\u8868\u8fbe\u5f0f\u4e2d\u5f00\u59cb\u62ec\u53f7\u7684\u987a\u5e8f\u51b3\u5b9a\u3002\u53c2\u89c1\u4e0b\u8868\u6240\u793a\u7684\u4e00\u4e9b\u5b50\u547d\u4ee4\u793a\u4f8b\u3002\u66ff\u6362\u547d\u4ee4\u7684\u683c\u5f0f\u662fs\/<pattern>\/ <replacement>\/g\u3002\u7ed3\u5c3e\u7684g\u662f\u53ef\u9009\u7684\uff0c\u5982\u679c\u5b83\u51fa\u73b0\u4e86\uff0c\u90a3\u4e48\u4ee3\u4f4d\u2010\u5c06\u662f\u6574\u4e2a\u5b57\u7b26\u4e32\u7684\u5168\u5c40\u53c2\u6570\u3002\u5982\u679cg\u88ab\u7701\u7565\uff0c\u90a3\u4e48\u53ea\u6709\u7b2c\u4e00\u4e2a\u5339\u914d\u6a21\u5f0f\u7684\u5b50\u4e32\u5c06\u88ab\u66ff\u6362<\/strong><\/p>\n<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2020\/03\/image-1585389149825.png\" alt=\"file\" \/><\/p>\n<p>\u53e6\u5916\u5355\u72ec\u63d0\u4e00\u4e0b\u8fd9\u4e2aDEFAULT:\u9ed8\u8ba4\u89c4\u5219\u5c06\u4e3b\u4f53\u540d\u79f0\u7f29\u5c0f\u4e3a\u4ec5\u5176\u7b2c\u4e00\u90e8\u5206\u3002<br \/>\n\u4f8b\u5982\uff0c\u5047\u8bbe\u9ed8\u8ba4\u57df\u662fTDH\uff0c\u5219\u9ed8\u8ba4\u89c4\u5219\u5c06\u4e3b\u4f53\u540d\u79f0hdfs@TDH\u6216hdfs\/node01@TDH\u7f29\u51cf\u4e3ahdfs<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6982\u8981\u63cf\u8ff0 hadoop.security.auth_to_local\u8fd9\u4e2a\u53c2\u6570\u5e38\u5e38\u7528\u6765\u914d\u7f6e\u5982\u4f55\u5904\u7406\u6765\u81ea\u5176\u4ed6rea ..<\/p>\n<div class=\"clear-fix\"><\/div>\n<p><a href=\"https:\/\/kbwp.transwarp.cn\/?p=2734\" title=\"read more...\">Read more<\/a><\/p>\n","protected":false},"author":12,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[],"class_list":["post-2734","post","type-post","status-publish","format-standard","hentry","category-configuration"],"acf":[],"_links":{"self":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/2734","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2734"}],"version-history":[{"count":2,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/2734\/revisions"}],"predecessor-version":[{"id":13920,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=\/wp\/v2\/posts\/2734\/revisions\/13920"}],"wp:attachment":[{"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2734"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2734"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kbwp.transwarp.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2734"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}