{"id":284842,"date":"2023-10-08T20:15:21","date_gmt":"2023-10-08T12:15:21","guid":{"rendered":"https:\/\/lrxjmw.cn\/jdksdlaz.html"},"modified":"2023-10-08T20:15:21","modified_gmt":"2023-10-08T12:15:21","slug":"jdksdlaz","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/jdksdlaz.html","title":{"rendered":"\u7b80\u5355\u5feb\u901f\u7684Linux LDAP\u5b89\u88c5"},"content":{"rendered":"

\u4f5c\u4e3a\u4e00\u540dIT\u8d44\u8baf\u8bb0\u8005\uff0c\u6211\u5c06\u4ee5\u65b0\u95fb\u5a92\u4f53\u7684\u98ce\u683c\u4e3a\u5927\u5bb6\u4ecb\u7ecd\u5982\u4f55\u5728Linux<\/a>\u7cfb\u7edf<\/a>\u4e0a\u5b89\u88c5LDAP\u3002\u8ba9\u6211\u4eec\u4e00\u8d77\u6765\u4e86\u89e3\u8fd9\u4e2a\u6709\u8da3\u4e14\u5b9e\u7528\u7684\u5185\u5bb9\u5427\uff01<\/p>\n

LDAP\uff1a\u65b9\u4fbf\u5feb\u6377\u5730\u7ba1\u7406\u7528\u6237\u4fe1\u606f<\/b><\/p>\n

LDAP\uff08\u8f7b\u91cf\u7ea7\u76ee\u5f55\u8bbf\u95ee\u534f\u8bae\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u5728\u7f51\u7edc\u4e0a\u8bbf\u95ee\u548c\u7ba1\u7406\u76ee\u5f55\u670d\u52a1\u7684\u534f\u8bae\u3002\u5b83\u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u4e14\u9ad8\u6548\u7684\u65b9\u5f0f\u6765\u5b58\u50a8\u3001\u7ec4\u7ec7\u548c\u68c0\u7d22\u7528\u6237\u4fe1\u606flinux\u5b89\u88c5\uff0c\u7279\u522b\u9002\u7528\u4e8e\u5927\u578b\u7ec4\u7ec7\u6216\u4f01\u4e1a\u3002<\/p>\n

\u63a5\u4e0b\u6765\uff0c\u8ba9\u6211\u4eec\u8be6\u7ec6\u4e86\u89e3\u4ee5\u4e0b\u5173\u4e8eLinux\u5b89\u88c5LDAP\u7684\u8981\u70b9\uff1a<\/p>\n

1.\u51c6\u5907\u5de5\u4f5c<\/b><\/p>\n

ldap\u5b89\u88c5linux_linux \u5b89\u88c5ldap_linuxldap\u5b89\u88c5<\/p>\n

\u9996\u5148linux \u5b89\u88c5ldap<\/strong>linux \u5220\u9664\u6587\u4ef6\u5939\uff0c\u786e\u4fdd\u4f60\u5df2\u7ecf\u5177\u5907\u7ba1\u7406\u5458\u6743\u9650\uff0c\u5e76\u4e14\u5df2\u7ecf\u5b89\u88c5\u4e86\u9002\u5408\u7684Linux\u53d1\u884c\u7248\u3002\u540c\u65f6\uff0c\u8fd8\u9700\u8981\u786e\u4fdd\u4f60\u5df2\u7ecf\u8fde\u63a5\u5230\u4e92\u8054\u7f51\uff0c\u5e76\u4e14\u80fd\u591f\u6b63\u5e38\u8bbf\u95ee\u8f6f\u4ef6\u6e90\u3002<\/p>\n

2.\u5b89\u88c5OpenLDAP\u8f6f\u4ef6\u5305<\/b><\/p>\n

\u4f7f\u7528\u5305\u7ba1\u7406\u5668\uff08\u5982apt\u3001yum\u7b49\uff09\u5b89\u88c5OpenLDAP\u8f6f\u4ef6\u5305\u3002\u5177\u4f53\u547d\u4ee4<\/a>\u53ef\u4ee5\u6839\u636e\u4f60\u6240\u4f7f\u7528\u7684Linux\u53d1\u884c\u7248\u8fdb\u884c\u8c03\u6574\u3002<\/p>\n

\n

shell\nsudo apt install slapd ldap-utils\n<\/pre>\n<\/p>\n

3.\u914d\u7f6eOpenLDAP<\/b><\/p>\n

\u5728\u5b89\u88c5\u5b8c\u6210\u540e\uff0c\u9700\u8981\u8fdb\u884c\u4e00\u4e9b\u57fa\u672c\u914d\u7f6e\u3002\u4f60\u9700\u8981\u8bbe\u7f6e\u7ba1\u7406\u5458\u5bc6\u7801\u4ee5\u53ca\u57df\u540d\u7b49\u4fe1\u606f\u3002\u8be6\u7ec6\u6b65\u9aa4\u53ef\u4ee5\u53c2\u8003\u76f8\u5173\u6587\u6863\u6216\u8005\u5b98\u65b9\u6307\u5357\u3002<\/p>\n

4.\u521b\u5efaLDAP\u6570\u636e\u5e93<\/b><\/p>\n

\u4f7f\u7528slapadd\u547d\u4ee4\u6765\u521b\u5efa\u4e00\u4e2a\u7a7a\u7684LDAP\u6570\u636e\u5e93\u3002\u8fd9\u4e2a\u547d\u4ee4\u5c06\u6839\u636e\u4f60\u7684\u914d\u7f6e\u6587\u4ef6\u6765\u521b\u5efa\u6570\u636e\u5e93\uff0c\u5e76\u4e3a\u5176\u5206\u914d\u76f8\u5e94\u7684\u76ee\u5f55\u3002<\/p>\n

\n

shell\nsudo slapadd -n 0 -F\/etc\/ldap\/slapd.d\n<\/pre>\n<\/p>\n

5.\u6dfb\u52a0LDAP\u7528\u6237<\/b><\/p>\n

\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528ldapadd\u547d\u4ee4\u6765\u6dfb\u52a0\u7528\u6237\u5230LDAP\u6570\u636e\u5e93\u4e2d\u3002\u4f60\u9700\u8981\u63d0\u4f9b\u4e00\u4e2aLDIF\uff08LDAP\u6570\u636e\u4ea4\u6362\u683c\u5f0f\uff09\u6587\u4ef6\uff0c\u5176\u4e2d\u5305\u542b\u4e86\u5f85\u6dfb\u52a0\u7684\u7528\u6237\u4fe1\u606f\u3002<\/p>\n

\n

shell\nldapadd -x-D\"cn=admin,dc=example,dc=com\"-W-f user.ldif\n<\/pre>\n<\/p>\n

ldap\u5b89\u88c5linux_linux \u5b89\u88c5ldap_linuxldap\u5b89\u88c5<\/p>\n

6.\u9a8c\u8bc1LDAP\u7528\u6237<\/b><\/p>\n

\u4f7f\u7528ldapsearch\u547d\u4ee4\u6765\u9a8c\u8bc1\u5df2\u7ecf\u6dfb\u52a0\u7684\u7528\u6237\u662f\u5426\u6b63\u786e\u3002\u4f60\u53ef\u4ee5\u6839\u636e\u9700\u8981\u8fdb\u884c\u81ea\u5b9a\u4e49\u641c\u7d22\u3002<\/p>\n

\n

shell\nldapsearch -x-b\"dc=example,dc=com\"\"(objectClass=*)\"\n<\/pre>\n<\/p>\n

7.\u914d\u7f6e\u5ba2\u6237\u7aef\u8bbf\u95ee<\/b><\/p>\n

linuxldap\u5b89\u88c5_linux \u5b89\u88c5ldap_ldap\u5b89\u88c5linux<\/p>\n

\u5982\u679c\u4f60\u60f3\u5728\u5176\u4ed6\u8ba1\u7b97\u673a\u4e0a\u8bbf\u95eeLDAP\u670d\u52a1\u5668\uff0c\u4f60\u9700\u8981\u914d\u7f6e\u5ba2\u6237\u7aef\u4ee5\u8fde\u63a5\u5230\u8be5\u670d\u52a1\u5668\u3002\u5177\u4f53\u914d\u7f6e\u65b9\u6cd5\u53ef\u4ee5\u53c2\u8003\u76f8\u5173\u6587\u6863\u6216\u8005\u5b98\u65b9\u6307\u5357\u3002<\/p>\n

8.\u9ad8\u7ea7\u529f\u80fd\u62d3\u5c55<\/b><\/p>\n

\u9664\u4e86\u57fa\u672c\u7684\u5b89\u88c5\u548c\u914d\u7f6e\u4e4b\u5916linux \u5b89\u88c5ldap<\/strong>\uff0cLDAP\u8fd8\u652f\u6301\u8bb8\u591a\u9ad8\u7ea7\u529f\u80fd\uff0c\u5982SSL\/TLS\u52a0\u5bc6\u3001\u8bbf\u95ee\u63a7\u5236\u7b49\u3002\u5982\u679c\u4f60\u5bf9\u8fd9\u4e9b\u529f\u80fd\u611f\u5174\u8da3\uff0c\u53ef\u4ee5\u8fdb\u4e00\u6b65\u6df1\u5165\u5b66\u4e60\u548c\u5b9e\u8df5\u3002<\/p>\n

\u901a\u8fc7\u4ee5\u4e0a\u51e0\u4e2a\u6b65\u9aa4\uff0c\u6211\u4eec\u5c31\u6210\u529f\u5730\u5728Linux\u7cfb\u7edf\u4e0a\u5b89\u88c5\u4e86LDAP\uff0c\u5e76\u4e14\u6dfb\u52a0\u4e86\u4e00\u4e9b\u7528\u6237\u4fe1\u606f\u3002\u73b0\u5728\uff0c\u4f60\u53ef\u4ee5\u8f7b\u677e\u5730\u7ba1\u7406\u548c\u8bbf\u95ee\u8fd9\u4e9b\u7528\u6237\u4fe1\u606f\u4e86\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

LDAP\uff08\u8f7b\u91cf\u7ea7\u76ee\u5f55\u8bbf\u95ee\u534f\u8bae\uff09\u662f\u4e00\u79cd\u7528\u4e8e\u5728\u7f51\u7edc\u4e0a\u8bbf\u95ee\u548c\u7ba1\u7406\u76ee\u5f55\u670d\u52a1\u7684\u534f\u8bae\u3002\u5b89\u88c5OpenLDAP\u8f6f\u4ef6\u5305\u4f7f\u7528\u5305\u7ba1\u7406\u5668\uff08\u5982apt\u3001yum\u7b49\uff09\u5b89\u88c5OpenLDAP\u8f6f\u4ef6\u5305\u3002-F\/etc\/ldap\/slapd.\u5982\u679c\u4f60\u60f3\u5728\u5176\u4ed6\u8ba1\u7b97\u673a\u4e0a\u8bbf\u95eeLDAP\u670d\u52a1\u5668\uff0c\u4f60\u9700\u8981\u914d\u7f6e\u5ba2\u6237\u7aef\u4ee5\u8fde\u63a5\u5230\u8be5\u670d\u52a1\u5668\u3002\u9664\u4e86\u57fa\u672c\u7684\u5b89\u88c5\u548c\u914d\u7f6e\u4e4b\u5916\uff0cLDAP\u8fd8\u652f\u6301\u8bb8\u591a\u9ad8\u7ea7\u529f\u80fd\uff0c\u5982SSL\/TLS\u52a0\u5bc6\u3001\u8bbf\u95ee\u63a7\u5236\u7b49\u3002<\/p>\n","protected":false},"author":1,"featured_media":284843,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-284842","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/284842","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=284842"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/284842\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/284843"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=284842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=284842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=284842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}