Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
centos:ldap:data [28.10.2011 05:39. ] – [erster Test] django | centos:ldap:data [20.04.2018 10:49. ] (aktuell) – Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== Datenerstbefüllung des OpenLDAP Servers ====== | ||
+ | {{: | ||
+ | |||
+ | Nachdem wir die [[centos: | ||
+ | |||
+ | Diese Daten, die aus Distinguished Names (DN) und einem eindeutigen Objektnamen bestehen, müssen hierzu in den **Directory Information Tree** (**DIT**), einer hierarchischen Baumstruktur eingefügt werden. | ||
+ | ===== Directory Information Tree ===== | ||
+ | Zur Übernahme bereits bestehender Nutzer aus dem LINUX-Grundsystem (**/ | ||
+ | ==== vorbereitende Konfiguration ==== | ||
+ | Bevor wir nun im Detail beginnen werden unsere DIT zu erstellen, beenden wir erst einmal unseren eventuell noch laufenden slapd-Dämon. | ||
+ | # service slapd status | ||
+ | |||
+ | slapd (pid 2024) is running... | ||
+ | |||
+ | # service slapd stop | ||
+ | |||
+ | | ||
+ | |||
+ | Im ersten Schritt werden wir nun unser Unterverzeichnis für die .ldif Dateistrukturen unseres DIT anlegen. | ||
+ | # mkdir / | ||
+ | Anschließend legen wir noch die Benutzer- und Gruppenrechte, | ||
+ | # chown ldap.ldap / | ||
+ | |||
+ | # chmod 700 / | ||
+ | Im letzten Schritt vor dem eigentlichem Erstellen der DIT erstellen wir uns noch eine Konfigurationsdatei für unsere verwendete Domäne // | ||
+ | # vim / | ||
+ | <file | / | ||
+ | ## Build the root node. | ||
+ | dn: dc=nausch, | ||
+ | dc: Nausch | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | ou: nausch Dot org | ||
+ | |||
+ | ## Build the Manager cn. | ||
+ | dn: cn=Manager, | ||
+ | cn: Manager | ||
+ | objectClass: | ||
+ | |||
+ | ## Build the People ou. | ||
+ | dn: ou=People, | ||
+ | ou: People | ||
+ | objectClass: | ||
+ | |||
+ | ## Build the Group ou. | ||
+ | dn: ou=Group, | ||
+ | ou: Group | ||
+ | objectClass: | ||
+ | </ | ||
+ | ==== Datenübernahme aus .ldif in die DIT ==== | ||
+ | Nachdem wir nun die vorbereitenden Aufgaben erledigt haben werden wir im nächsten Schritt die Daten aus der *.LDIF-Datei in den Directory Information Tree überführen. Hierzu benutzen wir nachfolgenden Befahlsaufruf: | ||
+ | # slapadd -v -l / | ||
+ | < | ||
+ | added: " | ||
+ | _############### | ||
+ | added: " | ||
+ | .#################### | ||
+ | Closing DB... | ||
+ | </ | ||
+ | Bevor wir nun unseren OpenLDAP-Server wieder starten korrigieren wir noch die Nutzerrechte der neu angelegten Dateien im Verzeichnis // | ||
+ | # chown ldap:ldap / | ||
+ | ==== erster Test ==== | ||
+ | Damit wir den gerade durchgeführten Import in den DIT auch überprüfen können, müssen wir unseren OpenLDAP-Server wieder starten. | ||
+ | # service slapd start | ||
+ | |||
+ | | ||
+ | Der erfolgreiche Start wurde im ldap-Logfile // | ||
+ | < | ||
+ | Oct 27 11:58:43 vml000030 slapd[8071]: | ||
+ | </ | ||
+ | Ob nun das Anlegen der DIT erfolgreich war oder nicht, fragen wir nun mit folgender Suchanfrage ab. | ||
+ | # ldapsearch -x -b " | ||
+ | < | ||
+ | # | ||
+ | # LDAPv3 | ||
+ | # base < | ||
+ | # filter: (objectclass=*) | ||
+ | # requesting: ALL | ||
+ | # | ||
+ | |||
+ | # nausch.org | ||
+ | dn: dc=nausch, | ||
+ | dc: Nausch | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | ou: nausch Dot org | ||
+ | |||
+ | # Manager, nausch.org | ||
+ | dn: cn=Manager, | ||
+ | cn: Manager | ||
+ | objectClass: | ||
+ | |||
+ | # People, nausch.org | ||
+ | dn: ou=People, | ||
+ | ou: People | ||
+ | objectClass: | ||
+ | |||
+ | # Group, nausch.org | ||
+ | dn: ou=Group, | ||
+ | ou: Group | ||
+ | objectClass: | ||
+ | |||
+ | # search result | ||
+ | search: 2 | ||
+ | result: 0 Success | ||
+ | |||
+ | # numResponses: | ||
+ | # numEntries: 4 | ||
+ | </ | ||
+ | Im Logfile des slapd-Daemon wird unsere erfolgreiche Abfrage entsprechend protokolliert. | ||
+ | < | ||
+ | Oct 27 12:04:26 vml000030 slapd[8071]: | ||
+ | Oct 27 12:04:26 vml000030 slapd[8071]: | ||
+ | Oct 27 12:04:26 vml000030 slapd[8071]: | ||
+ | Oct 27 12:04:26 vml000030 slapd[8071]: | ||
+ | Oct 27 12:04:26 vml000030 slapd[8071]: | ||
+ | Oct 27 12:04:26 vml000030 slapd[8071]: | ||
+ | </ | ||
+ | ===== Benutzermigration mit Hilfe der migrationstools ===== | ||
+ | In den seltensten Fällen haben wir eine Installation ohne jegliche Benutzer; in der Regel befinden sich auf unserem LINUX-System bereits angelegte Nutzer mit Ihren Konten. Diesen Nutzer wird immer eine UserID (**uid**) ab 500 zugewiesen. Somit ist eine Unterscheidung zwischen realen Nutzern und technischen Nutzeraccounts relativ leicht möglich. | ||
+ | Die hierzu erforderlichen Daten bekommen wir aus den beiden Dateien // | ||
+ | ==== Installation ==== | ||
+ | Zur leichteren Übernahme der Nutzerdaten bedienen wir uns der Hilfsprogramme aus dem RPM-Paket **migrationtools** aus dem Base-Repository, | ||
+ | # yum install migrationtools -y | ||
+ | Was uns dieses RPM-Paket alles an Hilfsmittel mitbringt zeigt uns ein Blick in das Paket selbst. | ||
+ | # rpm -qil migrationtools | ||
+ | < | ||
+ | Version | ||
+ | Release | ||
+ | Install Date: Thu 27 Oct 2011 12:23:20 PM CEST Build Host: c6b2.bsys.dev.centos.org | ||
+ | Group : System Environment/ | ||
+ | Size : 106663 | ||
+ | Signature | ||
+ | Packager | ||
+ | URL : http:// | ||
+ | Summary | ||
+ | Description : | ||
+ | The MigrationTools are a set of Perl scripts for migrating users, groups, | ||
+ | aliases, hosts, netgroups, networks, protocols, RPCs, and services from | ||
+ | existing nameservices (flat files, NIS, and NetInfo) to LDAP. | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | / | ||
+ | </ | ||
+ | ==== Konfiguration ==== | ||
+ | Vor der Migration unserer Daten ist es noch notwendig, das mitgelieferte Hilfsprogramm **migrate_common.ph** unserer Produktivumgebung anzupassen. | ||
+ | # vim / | ||
+ | <file bash | / | ||
+ | # | ||
+ | # $Id: migrate_common.ph, | ||
+ | # | ||
+ | # Copyright (c) 1997-2003 Luke Howard. | ||
+ | # All rights reserved. | ||
+ | # | ||
+ | # Redistribution and use in source and binary forms, with or without | ||
+ | # modification, | ||
+ | # are met: | ||
+ | # 1. Redistributions of source code must retain the above copyright | ||
+ | # notice, this list of conditions and the following disclaimer. | ||
+ | # 2. Redistributions in binary form must reproduce the above copyright | ||
+ | # notice, this list of conditions and the following disclaimer in the | ||
+ | # documentation and/or other materials provided with the distribution. | ||
+ | # 3. All advertising materials mentioning features or use of this software | ||
+ | # must display the following acknowledgement: | ||
+ | # This product includes software developed by Luke Howard. | ||
+ | # 4. The name of the other may not be used to endorse or promote products | ||
+ | # derived from this software without specific prior written permission. | ||
+ | # | ||
+ | # THIS SOFTWARE IS PROVIDED BY THE LUKE HOWARD ``AS IS'' | ||
+ | # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
+ | # IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
+ | # ARE DISCLAIMED. | ||
+ | # FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
+ | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
+ | # OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
+ | # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
+ | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
+ | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
+ | # SUCH DAMAGE. | ||
+ | # | ||
+ | |||
+ | # | ||
+ | # Common defines for MigrationTools | ||
+ | # | ||
+ | |||
+ | # Naming contexts. Key is $PROGRAM with migrate_ and .pl | ||
+ | # stripped off. | ||
+ | $NETINFOBRIDGE = (-x "/ | ||
+ | |||
+ | if ($NETINFOBRIDGE) { | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | } else { | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | $NAMINGCONTEXT{' | ||
+ | } | ||
+ | |||
+ | # Default DNS domain | ||
+ | # Django : 2011-10-27 Domäne nausch.org angepasst | ||
+ | # default : $DEFAULT_MAIL_DOMAIN = " | ||
+ | $DEFAULT_MAIL_DOMAIN = " | ||
+ | |||
+ | # Default base | ||
+ | # Django : 2011-10-27 Domäne nausch.org angepasst | ||
+ | # default : $DEFAULT_BASE = " | ||
+ | $DEFAULT_BASE = " | ||
+ | |||
+ | # Turn this on for inetLocalMailReceipient | ||
+ | # sendmail support; add the following to | ||
+ | # sendmail.mc (thanks to Petr@Kristof.CZ): | ||
+ | ##### CUT HERE ##### | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | ##### CUT HERE ##### | ||
+ | # where / | ||
+ | # domains (similiar to MASQUERADE_DOMAIN_FILE). | ||
+ | # $DEFAULT_MAIL_HOST = " | ||
+ | |||
+ | # turn this on to support more general object clases | ||
+ | # such as person. | ||
+ | $EXTENDED_SCHEMA = 0; | ||
+ | |||
+ | # | ||
+ | # allow environment variables to override predefines | ||
+ | # | ||
+ | if (defined($ENV{' | ||
+ | $DEFAULT_BASE = $ENV{' | ||
+ | } | ||
+ | |||
+ | if (defined($ENV{' | ||
+ | $DEFAULT_MAIL_DOMAIN = $ENV{' | ||
+ | } | ||
+ | |||
+ | if (defined($ENV{' | ||
+ | $DEFAULT_MAIL_HOST = $ENV{' | ||
+ | } | ||
+ | |||
+ | # binddn used for alias owner (otherwise uid=root, | ||
+ | if (defined($ENV{' | ||
+ | $DEFAULT_OWNER = $ENV{' | ||
+ | } | ||
+ | |||
+ | if (defined($ENV{' | ||
+ | $EXTENDED_SCHEMA = $ENV{' | ||
+ | } | ||
+ | |||
+ | # If we haven' | ||
+ | if (!defined($DEFAULT_BASE)) { | ||
+ | $DEFAULT_BASE = & | ||
+ | $DEFAULT_BASE =~ s/,$//o; | ||
+ | } | ||
+ | |||
+ | # Default Kerberos realm | ||
+ | #if ($EXTENDED_SCHEMA) { | ||
+ | # | ||
+ | # | ||
+ | #} | ||
+ | |||
+ | if (-x "/ | ||
+ | $REVNETGROUP = "/ | ||
+ | } elsif (-x "/ | ||
+ | $REVNETGROUP = "/ | ||
+ | } | ||
+ | |||
+ | $classmap{' | ||
+ | $classmap{' | ||
+ | $classmap{' | ||
+ | $classmap{' | ||
+ | $classmap{' | ||
+ | $classmap{' | ||
+ | $classmap{' | ||
+ | |||
+ | sub parse_args | ||
+ | { | ||
+ | if ($#ARGV < 0) { | ||
+ | print STDERR " | ||
+ | exit 1; | ||
+ | } | ||
+ | |||
+ | $INFILE = $ARGV[0]; | ||
+ | |||
+ | if ($#ARGV > 0) { | ||
+ | $OUTFILE = $ARGV[1]; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | sub open_files | ||
+ | { | ||
+ | open(INFILE); | ||
+ | if ($OUTFILE) { | ||
+ | open(OUTFILE,"> | ||
+ | $use_stdout = 0; | ||
+ | } else { | ||
+ | $use_stdout = 1; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | # moved from migrate_hosts.pl | ||
+ | # lukeh 10/30/97 | ||
+ | sub domain_expand | ||
+ | { | ||
+ | local($first) = 1; | ||
+ | local($dn); | ||
+ | local(@namecomponents) = split(/\./, $_[0]); | ||
+ | foreach $_ (@namecomponents) { | ||
+ | $first = 0; | ||
+ | $dn .= " | ||
+ | } | ||
+ | $dn .= $DEFAULT_BASE; | ||
+ | return $dn; | ||
+ | } | ||
+ | |||
+ | # case insensitive unique | ||
+ | sub uniq | ||
+ | { | ||
+ | local($name) = shift(@_); | ||
+ | local(@vec) = sort {uc($a) cmp uc($b)} @_; | ||
+ | local(@ret); | ||
+ | local($next, | ||
+ | foreach $next (@vec) { | ||
+ | if ((uc($next) ne uc($last)) && | ||
+ | (uc($next) ne uc($name))) { | ||
+ | push (@ret, $next); | ||
+ | } | ||
+ | $last = $next; | ||
+ | } | ||
+ | return @ret; | ||
+ | } | ||
+ | |||
+ | # concatenate naming context and | ||
+ | # organizational base | ||
+ | sub getsuffix | ||
+ | { | ||
+ | local($program) = shift(@_); | ||
+ | local($nc); | ||
+ | $program =~ s/ | ||
+ | $nc = $NAMINGCONTEXT{$program}; | ||
+ | if ($nc eq "" | ||
+ | return $DEFAULT_BASE; | ||
+ | } else { | ||
+ | return $nc . ',' | ||
+ | } | ||
+ | } | ||
+ | |||
+ | sub ldif_entry | ||
+ | { | ||
+ | # remove leading, trailing whitespace | ||
+ | local ($HANDLE, $lhs, $rhs) = @_; | ||
+ | local ($type, $val) = split(/\=/, $lhs); | ||
+ | local ($dn); | ||
+ | |||
+ | if ($rhs ne "" | ||
+ | $dn = $lhs . ',' | ||
+ | } else { | ||
+ | $dn = $lhs; | ||
+ | } | ||
+ | |||
+ | $type =~ s/\s*$//o; | ||
+ | $type =~ s/^\s*//o; | ||
+ | $type =~ tr/ | ||
+ | $val =~ s/\s*$//o; | ||
+ | $val =~ s/^\s*//o; | ||
+ | |||
+ | print $HANDLE "dn: $dn\n"; | ||
+ | print $HANDLE " | ||
+ | print $HANDLE " | ||
+ | print $HANDLE " | ||
+ | if ($EXTENDED_SCHEMA) { | ||
+ | if ($DEFAULT_MAIL_DOMAIN) { | ||
+ | print $HANDLE " | ||
+ | print $HANDLE " | ||
+ | } | ||
+ | } | ||
+ | |||
+ | print $HANDLE " | ||
+ | } | ||
+ | |||
+ | # Added Thu Jun 20 16:40:28 CDT 2002 by Bob Apthorpe | ||
+ | # < | ||
+ | # protocols and mail aliases. | ||
+ | sub escape_metacharacters | ||
+ | { | ||
+ | local($name) = @_; | ||
+ | |||
+ | # From Table 3.1 " | ||
+ | # in Distinguished Names", | ||
+ | # Directory Services", | ||
+ | |||
+ | # 1) Quote backslash | ||
+ | # Note: none of these are very elegant or robust and may cause | ||
+ | # more trouble than they' | ||
+ | # 1.a) naive (escape all backslashes) | ||
+ | # $name =~ s# | ||
+ | # | ||
+ | # 1.b) mostly naive (escape all backslashes not followed by | ||
+ | # a backslash) | ||
+ | # $name =~ s# | ||
+ | # | ||
+ | # 1.c) less naive and utterly gruesome (replace solitary | ||
+ | # backslashes) | ||
+ | # $name =~ s{ # Replace | ||
+ | # | ||
+ | # \\ # a single backslash | ||
+ | # | ||
+ | # } | ||
+ | # { # With | ||
+ | # \\\\ # a pair of backslashes | ||
+ | # }gx; | ||
+ | # Ugh. Note that s# | ||
+ | # starts or ends with a backslash. This expression won't work | ||
+ | # under perl4 because the /x flag and negative lookahead and | ||
+ | # lookbehind operations aren't supported. Sorry. Also note that | ||
+ | # s# | ||
+ | # this is all broken if $name is already escaped before we get | ||
+ | # to it. Best to throw a warning and make the user import these | ||
+ | # records by hand. | ||
+ | |||
+ | # 2) Quote leading and trailing spaces | ||
+ | local($leader, | ||
+ | if (($leader, $body, $trailer) = ($name =~ m#^( *)(.*\S)( *)$#o)) { | ||
+ | $leader =~ s# #\\ #og; | ||
+ | $trailer =~ s# #\\ #og; | ||
+ | $name = $leader . $body . $trailer; | ||
+ | } | ||
+ | |||
+ | # 3) Quote leading octothorpe (#) | ||
+ | $name =~ s/^#/\\#/o; | ||
+ | |||
+ | # 4) Quote comma, plus, double-quote, | ||
+ | # and semicolon | ||
+ | $name =~ s# | ||
+ | |||
+ | return $name; | ||
+ | } | ||
+ | |||
+ | 1; | ||
+ | |||
+ | </ | ||
+ | ==== Datenselektion ==== | ||
+ | Bevor wir nun im Detail beginnen werden unsere Userdaten in den DIT zu übernehmen, | ||
+ | # service slapd status | ||
+ | |||
+ | slapd (pid 2024) is running... | ||
+ | |||
+ | # service slapd stop | ||
+ | |||
+ | | ||
+ | |||
+ | Da wir nicht alle Nutzer, sondern nur die realen Benutzer in den DIT übernehmen wollen, extrahieren wir alle Nutzer aus der // | ||
+ | # grep ": | ||
+ | |||
+ | # grep ": | ||
+ | |||
+ | ==== Datenmigration ==== | ||
+ | Nun ist es an der Zeit unsere Nutzerdaten aus den zuvor angelegten temporären Dateien in entsprechende .ldif Dateien zu konvertieren. Hierzu nutzen wir die Hilfsprogramme aus dem zuvor installiertem RPM Paket **migrationtools**: | ||
+ | * **migrate_passwd.pl** | ||
+ | * **migrate_group.pl** | ||
+ | |||
+ | Wir erstellen also nun die beiden .ldif-Dateien. | ||
+ | # / | ||
+ | |||
+ | # / | ||
+ | |||
+ | Aus der Datei // | ||
+ | bigchief: | ||
+ | uid: django | ||
+ | cn: Django | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | userPassword: | ||
+ | shadowLastChange: | ||
+ | shadowMin: 0 | ||
+ | shadowMax: 99999 | ||
+ | shadowWarning: | ||
+ | loginShell: /bin/bash | ||
+ | uidNumber: 500 | ||
+ | gidNumber: 500 | ||
+ | homeDirectory: | ||
+ | gecos: Django | ||
+ | |||
+ | dn: uid=bigchief, | ||
+ | uid: bigchief | ||
+ | cn: BigChief | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | userPassword: | ||
+ | shadowLastChange: | ||
+ | shadowMin: 0 | ||
+ | shadowMax: 99999 | ||
+ | shadowWarning: | ||
+ | loginShell: /bin/bash | ||
+ | uidNumber: 501 | ||
+ | gidNumber: 501 | ||
+ | homeDirectory: | ||
+ | gecos: BigChief | ||
+ | |||
+ | </ | ||
+ | |||
+ | Aus der Datei // | ||
+ | bigchief: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | cn: django | ||
+ | userPassword: | ||
+ | gidNumber: 500 | ||
+ | |||
+ | dn: cn=bigchief, | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | cn: bigchief | ||
+ | userPassword: | ||
+ | gidNumber: 501 | ||
+ | |||
+ | </ | ||
+ | |||
+ | ==== Datenübernahme in den DIT ==== | ||
+ | Im nun folgenden Schritt werden wir die Daten aus den zuvor generierten .ldif-Dateien in den DIT übernehmen. | ||
+ | Vor dem Import passen wir noch die Nutzerrechte unserer .ldif-Dateien an. | ||
+ | # chown ldap:ldap / | ||
+ | Zu erst importieren wir die Inhalte aus der // | ||
+ | # slapadd -v -l / | ||
+ | < | ||
+ | _#################### | ||
+ | added: " | ||
+ | .#################### | ||
+ | Closing DB... | ||
+ | </ | ||
+ | Anschließend importieren wir die Inhalte aus der // | ||
+ | # slapadd -v -l / | ||
+ | < | ||
+ | added: " | ||
+ | _#################### | ||
+ | Closing DB... | ||
+ | </ | ||
+ | Bevor wir nun unseren OpenLDAP-Server wieder starten korrigieren wir noch die Nutzerrechte der neu angelegten Dateien im Verzeichnis **/ | ||
+ | ==== abschließender Test ==== | ||
+ | Damit wir den gerade durchgeführten User- und Gruppendaten-Import in den DIT auch überprüfen können, müssen wir unseren OpenLDAP-Server wieder starten. | ||
+ | # service slapd start | ||
+ | |||
+ | | ||
+ | Der erfolgreiche Start wurde im ldap-Logfile // | ||
+ | < | ||
+ | Oct 27 13:41:22 vml000030 slapd[8240]: | ||
+ | </ | ||
+ | Für den abschließenden Test, ob die Datenmigration aus den filebasierenden Dateien in den DIT unseres OpenLADP-Servers geklappt hat, befragen wir unseren LDAP-Server nach den Daten zum User //django//. | ||
+ | # ldapsearch -x -b " | ||
+ | < | ||
+ | # | ||
+ | # LDAPv3 | ||
+ | # base < | ||
+ | # filter: (objectclass=*) | ||
+ | # requesting: ALL | ||
+ | # | ||
+ | |||
+ | # django, People, nausch.org | ||
+ | dn: uid=django, | ||
+ | uid: django | ||
+ | cn: Django | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | objectClass: | ||
+ | shadowLastChange: | ||
+ | shadowMin: 0 | ||
+ | shadowMax: 99999 | ||
+ | shadowWarning: | ||
+ | loginShell: /bin/bash | ||
+ | uidNumber: 500 | ||
+ | gidNumber: 500 | ||
+ | homeDirectory: | ||
+ | gecos: Django | ||
+ | |||
+ | # search result | ||
+ | search: 2 | ||
+ | result: 0 Success | ||
+ | |||
+ | # numResponses: | ||
+ | # numEntries: 1 | ||
+ | </ | ||
+ | Unsere erfolgreiche Abfrage erzeugt einen entsprechendnen Eintrag im Logfile des slapd-Daemon. | ||
+ | < | ||
+ | Oct 27 13:43:30 vml000030 slapd[8240]: | ||
+ | Oct 27 13:43:30 vml000030 slapd[8240]: | ||
+ | Oct 27 13:43:30 vml000030 slapd[8240]: | ||
+ | Oct 27 13:43:30 vml000030 slapd[8240]: | ||
+ | Oct 27 13:43:30 vml000030 slapd[8240]: | ||
+ | Oct 27 13:43:30 vml000030 slapd[8240]: | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== Links ====== | ||
+ | * **[[centos: | ||
+ | * **[[wiki: | ||
+ | * **[[http:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||