{"id":86,"date":"2011-02-11T13:25:38","date_gmt":"2011-02-11T13:25:38","guid":{"rendered":"http:\/\/songoku.homelinux.com\/wordpress\/?p=86"},"modified":"2011-02-11T13:25:38","modified_gmt":"2011-02-11T13:25:38","slug":"ldappdc-on-centos5","status":"publish","type":"post","link":"https:\/\/ndk.sytes.net\/wordpress\/?p=86","title":{"rendered":"LDAP\/PDC on CentOS5"},"content":{"rendered":"<p>Hi,<\/p>\n<p>&nbsp;<\/p>\n<p>after reading several tutorials and howtos for building a ldap-pdc i decided to write this small howto build on three different tutorials. Each one of them had it&#39;s small &quot;bugs&quot; so here is what worked for me:<\/p>\n<p>&nbsp;<\/p>\n<h3>1. Building LDAP Server<\/h3>\n<p>install openldap, set ldap password and edit slapd.conf:<\/p>\n<p>&nbsp;<\/p>\n<p><em>~# yum install openldap-servers openldap-clients<\/em><br \/>\n\t<em>~# slappasswd -h {SSHA}<\/em><br \/>\n\t<em>~# vim \/etc\/openldap\/slapd.conf<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>change some lines:<\/p>\n<p>&nbsp;<\/p>\n<p>suffix&nbsp; &quot;dc=DOMAIN,dc=LOCAL&quot;<br \/>\n\trootdn&nbsp; &quot;cn=Manager,dc=DOMAIN,dc=LOCAL&quot;<br \/>\n\trootpw&nbsp; {SSHA}PASSWORD -&gt; generated with slapppasswd<\/p>\n<p>&nbsp;<\/p>\n<p>add this to the file:<\/p>\n<p>&nbsp;<\/p>\n<p>include \/etc\/openldap\/schema\/samba.schema<br \/>\n\taccess to attrs=userPassword,sambaLMPassword,sambaNTPassword<br \/>\n\t&nbsp;&nbsp;&nbsp; by self write<br \/>\n\t&nbsp;&nbsp;&nbsp; by dn=&quot;cn=Manager,dc=DOMAINdc=LOCAL&quot; write<br \/>\n\t&nbsp;&nbsp;&nbsp; by anonymous auth<br \/>\n\t&nbsp;&nbsp;&nbsp; by * none<\/p>\n<p>\taccess to *<br \/>\n\t&nbsp;&nbsp;&nbsp; by dn=&quot;cn=Manager,dc=DOMAIN,dc=LOCAL&quot; write<br \/>\n\t&nbsp;&nbsp;&nbsp; by self write<br \/>\n\t&nbsp;&nbsp;&nbsp; by * read<\/p>\n<p>&nbsp;<\/p>\n<p>copy database<\/p>\n<p>&nbsp;<\/p>\n<p><em>~# cp \/etc\/openldap\/DB_CONFIG.example \/var\/lib\/ldap\/DB_CONFIG<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>now start the ldap server and add it to startup:<\/p>\n<p>&nbsp;<\/p>\n<p><em>~# \/etc\/init.d\/ldap start<\/em><br \/>\n\t<em>~# chkconfig ldap on<\/em><\/p>\n<p>&nbsp;<\/p>\n<h3>2. Add initial and exisitng users\/groups<\/h3>\n<p>change some lines in the migration script:<\/p>\n<p>&nbsp;<\/p>\n<p><em>~# vim \/usr\/share\/openldap\/migration\/migrate_common.ph<\/em><\/p>\n<p>&nbsp;<\/p>\n<p>$DEFAULT_MAIL_DOMAIN = &quot;DOMAIN.LCOAL&quot;;<br \/>\n\t$DEFAULT_BASE = &quot;dc=DOMAIN,dc=LOCAL&quot;;<\/p>\n<p>&nbsp;<\/p>\n<p>after that fill the ldap database<\/p>\n<p>&nbsp;<\/p>\n<p><em>~# \/usr\/share\/openldap\/migration\/migrate_base.pl &gt; base.ldif<\/em><br \/>\n\t<em>~# ldapadd -x -W -D &quot;cn=Manager,dc=DOMAIN,dc=LOCAL&quot; -f base.ldif<\/em><br \/>\n\t<em>~# grep &quot;x:[5-9][0-9][0-9]&quot; \/etc\/passwd &gt; passwd<\/em><br \/>\n\t<em>~# grep &quot;x:[5-9][0-9][0-9]&quot; \/etc\/group &gt; group<\/em><br \/>\n\t<em>~# \/usr\/share\/openldap\/migration\/migrate_passwd.pl passwd &gt; passwd.ldif<\/em><br \/>\n\t<em>~# \/usr\/share\/openldap\/migration\/migrate_group.pl group &gt; group.ldif<\/em><br \/>\n\t<em>~# ldapadd -x -W -D &quot;cn=Manager,dc=DOMAIN,dc=LOCAL&quot; -f passwd.ldif<\/em><br \/>\n\t<em>~# ldapadd -x -W -D &quot;cn=Manager,dc=DOMAIN,dc=LOCAL&quot; -f group.ldif<\/em><\/p>\n<p>&nbsp;<\/p>\n<h3>3. Setup SAMBA<\/h3>\n<p>to keep it short: check <a href=\"http:\/\/www.server-world.info\/en\/note?os=CentOS_5&amp;p=samba&amp;f=4\">here<\/a> and <a href=\"http:\/\/www.howtoforge.com\/centos-5.x-samba-domain-controller-with-ldap-backend-p2\" target=\"_blank\">here.<\/a><a href=\"http:\/\/www.server-world.info\/en\/note?os=CentOS_5&amp;p=samba&amp;f=4\" target=\"_blank\"><br \/>\n\t<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi, &nbsp; after reading several tutorials and howtos for building a ldap-pdc i decided to write this small howto build on three different tutorials. Each one of them had it&#39;s small &quot;bugs&quot; so here is what worked for me: &nbsp; 1. Building LDAP Server install openldap, set ldap password and edit slapd.conf: &nbsp; ~# yum [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,7],"tags":[],"class_list":["post-86","post","type-post","status-publish","format-standard","hentry","category-linuxunix","category-servers"],"_links":{"self":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=86"}],"version-history":[{"count":0,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/86\/revisions"}],"wp:attachment":[{"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ndk.sytes.net\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}