Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung | ||
fortgeschrittene:samba-ldap-pdc [2011/04/07 20:20] iw [Die smbldap-tools von IDEALX] |
fortgeschrittene:samba-ldap-pdc [2013/10/16 15:52] (aktuell) |
||
---|---|---|---|
Zeile 19: | Zeile 19: | ||
#LDAP Anbindung: | #LDAP Anbindung: | ||
passdb backend = ldapsam:ldap://ldap1.villa.local | passdb backend = ldapsam:ldap://ldap1.villa.local | ||
- | ldap suffix = dc=villa,dc=local | + | ldap suffix = dc=villa,dc=local |
- | ldap admin dn = "cn=admin,dc=villa,dc=local" | + | ldap admin dn = "cn=admin,dc=villa,dc=local" |
- | ldap user suffix = ou=people | + | ldap user suffix = ou=people |
- | ldap group suffix = ou=groups | + | ldap group suffix = ou=groups |
ldap machine suffix = ou=computers | ldap machine suffix = ou=computers | ||
- | ldap idmap suffix = ou=people | + | ldap idmap suffix = ou=people |
ldap ssl = off | ldap ssl = off | ||
Zeile 39: | Zeile 39: | ||
Das Passwort des in der ''smb.conf'' genannten LDAP Admin muß dem Samba Server im Klartext vorliegen: | Das Passwort des in der ''smb.conf'' genannten LDAP Admin muß dem Samba Server im Klartext vorliegen: | ||
smbpasswd -W | smbpasswd -W | ||
+ | |||
==== Testen ==== | ==== Testen ==== | ||
Ist der Samba-Server PDC? | Ist der Samba-Server PDC? | ||
nmblookup -m kurs#1b | nmblookup -m kurs#1b | ||
- | ===== LDAP Verzeichnis anpassen ===== | + | ===== Rechner der Domäne hinzufügen ===== |
+ | Dazu gibt es 4 Möglichkeiten: | ||
+ | * von Hand | ||
+ | * mit den smbldap-tools | ||
+ | * ''ldapsmb'' | ||
+ | * und ab Samba 3.0.25 kann samba das mit den Parametern ''ldapsam:trusted'' und ''ldapsam:editposix'' selbst | ||
+ | |||
+ | ==== von Hand ==== | ||
+ | === LDAP Verzeichnis anpassen === | ||
Im LDAP Verzeichnis müssen nun noch Einträge für | Im LDAP Verzeichnis müssen nun noch Einträge für | ||
* den in der ''smb.conf'' im Parameter ''ldap machine suffix'' genannten Teilbaum, | * den in der ''smb.conf'' im Parameter ''ldap machine suffix'' genannten Teilbaum, | ||
Zeile 58: | Zeile 67: | ||
</code> | </code> | ||
<file> | <file> | ||
- | dn: ou=computers,$DOMAIN | + | TODO muss neu erzerugt werden |
- | objectClass: top | + | |
- | objectClass: organizationalUnit | + | |
- | ou: computers | + | |
- | + | ||
- | dn: cn=workstations,ou=groups,$DOMAIN | + | |
- | objectClass: top | + | |
- | objectClass: posixGroup | + | |
- | gidNumber: 515 | + | |
- | cn: workstations | + | |
- | + | ||
- | dn: cn=domadmins,ou=groups,$DOMAIN | + | |
- | objectClass: posixGroup | + | |
- | objectClass: sambaGroupMapping | + | |
- | gidNumber: 512 | + | |
- | cn: domadmins | + | |
- | sambaSID: $SID-512 | + | |
- | sambaGroupType: 2 | + | |
- | displayName: Domain Admins | + | |
- | description: Domain Administrators | + | |
- | + | ||
- | dn: cn=domusers,ou=groups,$DOMAIN | + | |
- | objectClass: posixGroup | + | |
- | objectClass: sambaGroupMapping | + | |
- | gidNumber: 513 | + | |
- | cn: domusers | + | |
- | sambaSID: $SID-513 | + | |
- | sambaGroupType: 2 | + | |
- | displayName: Domain Users | + | |
- | description: Domain Users | + | |
- | + | ||
- | dn: cn=domguests,ou=groups,$DOMAIN | + | |
- | objectClass: posixGroup | + | |
- | objectClass: sambaGroupMapping | + | |
- | gidNumber: 514 | + | |
- | cn: domguests | + | |
- | sambaSID: $SID-514 | + | |
- | sambaGroupType: 2 | + | |
- | displayName: Domain Guests | + | |
- | description: Domain Guests Users | + | |
- | + | ||
- | dn: uid=smbadmin,ou=people,$DOMAIN | + | |
- | objectClass: top | + | |
- | objectClass: posixAccount | + | |
- | objectClass: account | + | |
- | cn: Samba Domain Admin | + | |
- | uid: smbadmin | + | |
- | uidNumber: 10001 | + | |
- | gidNumber: 512 | + | |
- | homeDirectory: /home/smbadmin | + | |
- | loginShell: /bin/false | + | |
- | LDIF | + | |
</file> | </file> | ||
- | ===== Domänenadmin anpassen ===== | + | === Domänenadmin anpassen === |
smbpasswd -a smbadmin | smbpasswd -a smbadmin | ||
Unter Windows hat der Domänenadmin immer die RID 500: | Unter Windows hat der Domänenadmin immer die RID 500: | ||
Zeile 125: | Zeile 83: | ||
Überprüfen: | Überprüfen: | ||
net -U smbadmin rpc rights list smbadmin | net -U smbadmin rpc rights list smbadmin | ||
+ | | ||
+ | Alternativ: | ||
+ | net sam rights grant ntadmin SeMachineAccountPrivilege SeAddUsersPrivilege | ||
+ | |||
- | ===== Rechner der Domäne hinzufügen ===== | + | === Rechner hinzufügen === |
- | Dazu gibt es 4 Möglichkeiten: | + | |
- | * von Hand | + | |
- | * mit den smbldap-tools | + | |
- | * ''ldapsmb'' | + | |
- | * und ab Samba 3.0.25 kann samba das mit den Parametern ''ldapsam:trusted'' und ''ldapsam:editposix'' selbst | + | |
- | ==== von Hand ==== | + | |
Wie bei normalen Benutzern auch muß zu einem Samba-Maschinen-Account auch ein Unix/Linux Account existieren. Um einen Rechner mit dem Namen "vm2000" der Domäne hinzuzufügen sind daher folgende Schritte notwendig: | Wie bei normalen Benutzern auch muß zu einem Samba-Maschinen-Account auch ein Unix/Linux Account existieren. Um einen Rechner mit dem Namen "vm2000" der Domäne hinzuzufügen sind daher folgende Schritte notwendig: | ||
Zeile 150: | Zeile 106: | ||
loginShell: /bin/false | loginShell: /bin/false | ||
uid: $MACHINE$ | uid: $MACHINE$ | ||
+ | |||
LDIF | LDIF | ||
</file> | </file> | ||
Zeile 159: | Zeile 116: | ||
==== smbldap-tools ==== | ==== smbldap-tools ==== | ||
- | Auch die Idealix-Skripte sind für diesen Einsatzfall geschrieben worden. | + | ''/etc/samba/smb.conf'' : |
- | Debian-Paket: ''smbldap-tools'' | + | |
- | + | ||
- | === Doku === | + | |
- | * ''/usr/share/doc/smbldap-tools/README.Debian.gz'' | + | |
- | + | ||
- | ==== ldapsmb ==== | + | |
- | Alternativ gibt es bei SuSE das Paket ''ldapsmb'' als einfaches Beispiel für ein ''add machine script'': | + | |
- | + | ||
- | ( noch nicht getestet ) | + | |
- | + | ||
- | ==== ldapsam:editposix ==== | + | |
- | siehe | + | |
- | man smb.conf | + | |
- | + | ||
- | Kann aktuell noch nicht mit inetOrgPerson u.ä. umgehen. | + | |
- | + | ||
- | + | ||
- | ====== Webmin - Modul LDAP Useradmin ====== | + | |
- | SuSE: | + | |
- | http://www.webmin.com | + | |
- | + | ||
- | Einstellungen | + | |
- | ''/etc/webmin/ldap-useradmin/config'': ( SuSE ) | + | |
- | <file> | + | |
- | samba_def=1 | + | |
- | samba_class=sambaSamAccount | + | |
- | samba_gclass=sambaGroupMapping | + | |
- | samba_domain=S-1-5-21-2516115203-501549975-3175969160 | + | |
- | </file> | + | |
- | + | ||
- | ====== Die smbldap-tools von IDEALX ====== | + | |
- | Auf Debian mit Samba 3.0.24 und den mitgelieferten smbldap-tools funktionierte das Hinzufügen von Maschinenaccounts zu einem PDC. Getestet von MichaelWandel. | + | |
- | + | ||
- | ''/etc/samba/smb.conf'': | + | |
<file> | <file> | ||
[global] | [global] | ||
Zeile 199: | Zeile 122: | ||
<file> | <file> | ||
ldap delete dn = Yes | ldap delete dn = Yes | ||
+ | unix password sync = Yes | ||
passwd program = /usr/sbin/smbldap-passwd %u | passwd program = /usr/sbin/smbldap-passwd %u | ||
- | passwd chat = *New*password* %n\n *Retype*new*password* %n\n *all*authentication*tokens*updated* | + | |
add user script = /usr/sbin/smbldap-useradd -m "%u" | add user script = /usr/sbin/smbldap-useradd -m "%u" | ||
delete user script = /usr/sbin/smbldap-userdel "%u" | delete user script = /usr/sbin/smbldap-userdel "%u" | ||
- | add machine script = /usr/sbin/smbldap-useradd -w "%u" | + | add machine script = /usr/sbin/smbldap-useradd -t 2 -w "%u" |
- | add group script = /usr/sbin/smbldap-groupadd -p "%g" | + | add group script = /usr/sbin/smbldap-groupadd -a "%g" |
delete group script = /usr/sbin/smbldap-groupdel "%g" | delete group script = /usr/sbin/smbldap-groupdel "%g" | ||
add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g" | add user to group script = /usr/sbin/smbldap-groupmod -m "%u" "%g" | ||
Zeile 222: | Zeile 146: | ||
''/etc/smbldap-tools/smbldap.conf'' : | ''/etc/smbldap-tools/smbldap.conf'' : | ||
<file> | <file> | ||
- | SID="S-1-5-21-2320849130-3131792283-2083377348" | + | #SID="S-1-5-21-2320849130-3131792283-2083377348" |
+ | </file> | ||
+ | <file> | ||
sambaDomain="kurs" | sambaDomain="kurs" | ||
+ | </file> | ||
+ | <file> | ||
slaveLDAP="localhost" | slaveLDAP="localhost" | ||
+ | </file> | ||
+ | <file> | ||
masterLDAP="localhost" | masterLDAP="localhost" | ||
+ | </file> | ||
+ | <file> | ||
ldapTLS="0" | ldapTLS="0" | ||
+ | </file> | ||
+ | <file> | ||
suffix="dc=linuxhotel,dc=de" | suffix="dc=linuxhotel,dc=de" | ||
+ | </file> | ||
+ | <file> | ||
+ | usersdn="ou=People,${suffix}" | ||
+ | </file> | ||
+ | <file> | ||
idmapdn="ou=People,${suffix}" | idmapdn="ou=People,${suffix}" | ||
+ | </file> | ||
+ | <file> | ||
userSmbHome="" | userSmbHome="" | ||
+ | </file> | ||
+ | <file> | ||
userProfile="" | userProfile="" | ||
+ | </file> | ||
+ | <file> | ||
+ | userScript="" | ||
</file> | </file> | ||
chmod 0644 /etc/smbldap-tools/smbldap.conf | chmod 0644 /etc/smbldap-tools/smbldap.conf | ||
chmod 0600 /etc/smbldap-tools/smbldap_bind.conf | chmod 0600 /etc/smbldap-tools/smbldap_bind.conf | ||
- | ./smbldap-populate -a smbadmin | + | smbldap-populate -a smbadmin -e /tmp/samba.ldif |
+ | ''/tmp/samba.ldif'' prüfen (( Todo: ''smbadmin'' checken: ''uidNumber'' und ''gidNumber'' auf einen anderen Wert als 0 ändern ... )) | ||
+ | ldapadd -x -W -D cn=admin,dc=example,dc=com -f /tmp/samba.ldif -h ldap1.example.com | ||
+ | (( oder direkt | ||
+ | smbldap-populate -a smbadmin | ||
+ | eingeben und nachträglich ''uidNumber'' und ''gidNumber'' auf einen anderen Wert als 0 ändern | ||
+ | )) | ||
+ | |||
+ | |||
+ | === Doku === | ||
+ | * ''/usr/share/doc/smbldap-tools/README.Debian.gz'' | ||
+ | |||
+ | ==== ldapsmb ==== | ||
+ | Alternativ gibt es bei SuSE das Paket ''ldapsmb'' als einfaches Beispiel für ein ''add machine script'': | ||
+ | |||
+ | ( noch nicht getestet ) | ||
+ | |||
+ | ==== ldapsam:editposix ==== | ||
+ | siehe | ||
+ | man smb.conf | ||
+ | |||
+ | Ist beschrankt auf ''obejectclass=account'', kann aktuell noch nicht mit inetOrgPerson u.ä. umgehen. | ||
+ | |||
+ | |||
+ | ====== Webmin - Modul LDAP Useradmin ====== | ||
+ | SuSE: | ||
+ | http://www.webmin.com | ||
+ | |||
+ | Einstellungen | ||
+ | ''/etc/webmin/ldap-useradmin/config'': ( SuSE ) | ||
+ | <file> | ||
+ | samba_def=1 | ||
+ | samba_class=sambaSamAccount | ||
+ | samba_gclass=sambaGroupMapping | ||
+ | samba_domain=S-1-5-21-2516115203-501549975-3175969160 | ||
+ | </file> | ||
| | ||
+ | |||
+ | |||
====== Dokus & Links ====== | ====== Dokus & Links ====== | ||
* Howto für SuSE: http://en.opensuse.org/Howto_setup_SUSE_as_SAMBA_PDC_with_OpenLDAP%2C_DYNDNS_and_CLAM | * Howto für SuSE: http://en.opensuse.org/Howto_setup_SUSE_as_SAMBA_PDC_with_OpenLDAP%2C_DYNDNS_and_CLAM | ||
* Alternatives LDAP Setup : http://wiki.samba.org/index.php/Ldapsam_Editposix | * Alternatives LDAP Setup : http://wiki.samba.org/index.php/Ldapsam_Editposix | ||