{"id":686,"date":"2009-10-24T15:20:00","date_gmt":"2009-10-24T07:20:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=686"},"modified":"2023-11-04T15:29:54","modified_gmt":"2023-11-04T07:29:54","slug":"freeradius-openldap","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/686","title":{"rendered":"Freeradius Openldap"},"content":{"rendered":"\n<p>freeradius\u7d50\u5408openldap<\/p>\n\n\n\n<p>1<br><strong>\u8a2d\u5b9aFreeRadius \u8207 LDAP Server<\/strong><br># cd \/usr\/local\/etc\/raddb<br># cp \/usr\/local\/share\/examples\/freeradius\/raddb\/ldap.attrmap .<\/p>\n\n\n\n<p>2<br><strong>\u7de8\u8f2fuser\u9019\u6a94\u6848<\/strong><br>\u8a2d\u5b9a\u4f7f\u7528ldap\u8a8d\u8b49<br>DEFAULT Auth-Type := LDAP<br>Fall-Through = 1<\/p>\n\n\n\n<p>3<br><strong>\u8a2d\u5b9aradius.conf<\/strong><br><strong>\u5728module\u5340\u6bb5\u5167\u8a2d\u5b9a\u4ee5\u4e0b<\/strong><br>ldap { #\u5b9a\u7fa9rlm_ldap\u6a21\u7d44<br>server = &#8220;127.0.0.1&#8221;<br>#ldap\u4e3b\u6a5f\u4f4d\u7f6e<br><br>identity = &#8220;cn=root,dc=xxx,dc=xxx,dc=xxx,dc=xxx&#8221;<br>password = xxxxxxx<br>#\u7e6b\u7d50ldap\u4e3b\u6a5f\u6703\u4f7f\u7528identity\u505a\u70badn,\u4f7f\u7528password\u505a\u70ba\u8a72\u5bc6\u78bc<br><br>basedn = &#8220;dc=xxx,dc=xxx,dc=xxx,dc=xxx&#8221;<br>#\u641c\u5c0b\u4f7f\u7684\u57fa\u672c\u8b58\u5225\u540d\u7a31<br><br>filter = &#8220;(uid=%{Stripped-User-Name:-%{User-Name}})&#8221;<br>#filter\u7684\u8a2d\u5b9a\u4f9d\u64darfc2254,\u9810\u8a2d\u503c\u70ba(uid=%u)<br><br>ldap_connections_number = 5<br>#radius\u6240\u80fd\u7dad\u6301\u7684\u9023\u7dda\u7e3d\u6578<br><br>password_attribute = userPassword<br>#\u4f7f\u7528\u8005\u5bc6\u78bc\u4e4b\u5c6c\u6027<br>password_header = &#8220;{crypt}&#8221;<br>#\u53bb\u9664\u5bc6\u78bc\u958b\u982d\u7684\u6a19\u982d,ex:{CRYPT}<br><br>access_attr = &#8220;uid&#8221;<br>dictionary_mapping = ${raddbdir}\/ldap.attrmap<br>edir_account_policy_check=no<br>timeout = 4<br>timelimit = 3<br>net_timeout = 1<br>}<br><strong>\u5728authenticate\u5340\u6bb5\u5167\u8a2d\u5b9a\u4ee5\u4e0b<\/strong><br>Auth-Type LDAP {<br>\u3000ldap<br>}<br><strong>\u5728authorize\u5340\u6bb5\u5167\u8a2d\u5b9a\u4ee5\u4e0b<\/strong><br>ldap<\/p>\n\n\n\n<p><br>4<br><strong>\u8a2d\u5b9a client.conf<\/strong><br>\u9996\u5148\u5148\u628a\u4e0b\u9762\u5340\u584a\u88e1\u7684\u5bc6\u78bc\u66f4\u6539\u4e00\u4e0b<br>client 127.0.0.1 {<br>\u3000secret = \u6821\u5712\u5167\u90e8\u5bc6\u78bc<br>}<\/p>\n\n\n\n<p>5<br><strong>\u91cd\u555f\u52d5 FreeRadius<\/strong><br>\u6e2c\u8a66 Radius \u662f\u5426\u6709\u53bb\u627e LDAP \u9a57\u8b49<br>\u57f7\u884cradtest &lt;\u5e33\u865f&gt; &lt;\u5bc6\u78bc&gt; &lt; \u8a8d\u8b49\u4f4d\u5740[:\u8a8d\u8b49\u57e0]&gt; &lt; nas-port-number&gt; &lt; secret &gt;<br>\u82e5\u6210\u529f\u6703\u51fa\u73ferad_recv: Access-Accept &#8230;\u7b49\u8a0a\u606f<br>\u82e5\u5931\u6557\u6703\u51fa\u73ferad_recv: Access-Reject &#8230;\u7b49\u8a0a\u606f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>freeradius\u7d50\u5408openldap 1\u8a2d\u5b9aFreeRa &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[21],"tags":[],"class_list":["post-686","post","type-post","status-publish","format-standard","hentry","category-linuxservice"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=686"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/686\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=686"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}