MS Active Directory mit Samba tanzen lassen…
1. Als Erstes installieren wir mal die benötigten Pakete:
1 |
apt-get install libkrb53 krb5-{admin-server,kdc} samba winbind ntpdate ntp ssh |
Der Debian “debconf” Dienst wird und die ein oder andere Frage stellen, egal wie wir diese beantworten, wir kümmern uns später
ohnehin darum.
2. Nachdem wir mit Schritt 1 durch sind müssen wir drei Dienste wieder stoppen.
1 |
/etc/init.d/samba stop && /etc/init.d/winbind stop && /etc/init.d/ntp stop |
3. Wir sichern uns die Konfigurationsdateien
1 2 3 4 5 |
cp -p /etc/samba/smb.conf /etc/samba/smb.conf.bak cp -p /etc/nsswitch.conf /etc/nsswitch.conf.bak cp -p /etc/krb5.conf /etc/krb5.conf.bak cp -a /etc/pam.d /etc/pam.d.bak cp -a /var/lib/samba /var/lib/samba.bak |
4. Wir editieren die /etc/krb5.conf wie folgt ab, so das diese später so aussieht:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[libdefaults] Default_realm = TUXCLOUDS.LOCAL #The following krb5.conf variables are only for MIT Kerberos. krb4_config = /etc/krb.conf krb4_realms = /etc/krb.realms kdc_timesync = 1 ccache_type = 4 forwardable = true proxiable = true [realms] TUXCLOUDS.LOCAL = { kdc = dc1.tuxclouds.local admin_server = dc1.tuxclouds.local } [domain_realm] .tuxclouds.local = TUXCLOUDS.LOCAL [login] krb4_convert = true krb4_get_tickets = false |
5. Wir editieren die NTP Konfiguration in /etc/ntp.conf An der Stelle wo die drei oder vier von der Debian ntp Installation vorgegebenen Zeitserver stehen setzten wir ein “#” Kommentarzeichen davor. Und fügen eine Zeile darunter an:
1 |
server 192.168.2.6 |
6. Wir führen den Befehl ntpdate aus um die Zeit zu syncronisieren
1 |
ntpdate 192.168.2.6 |
7. Wir starten den NTP Dienst
1 |
/etc/init.d/ntp start |
8. Wir testen unser Schaffen
1 |
ntpq -p |
9. Wir erstellen eine neue Samba Konfiguration ungefähr so: /etc/samba/smb.conf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
[global] workgroup = TUXCLOUDS realm = TUXCLOUDS.LOCAL netbios name = SAMBA server string = Kommentar log level = 3 security = ads password server = dc01 ((fqdn) domain controller) idmap uid = 500-10000000 idmap gid = 500-10000000 winbind separator = + winbind enum users = no winbind enum groups = no winbind use default domain = yes template homedir = /home/%D/%U template shell = /bin/bash client use spnego = yes domain master = no #Umlaute-Definition display charset = ISO-8859-15 dos charset = cp850 unix charset = ISO-8859-15 #Drucker printcap name = /dev/null load printers = no printing = bsd #Freigabendefinitionen [baessler] comment = Daten Freigabe path = /home/daten public = no read only = no guest ok = no browseable = yes writeable = yes valid users = @sicherheitsgruppe,benutzername,benutzername admin users = @sicherheitsgruppe,benutzername create mask = 0770 directory mask = 0770 create mode = 0770 directory mode = 0770 # Unix Benutzer smbuser und die Gruppe müssten vorher natürlich auf dem System vorhanden sein. force group = smbuser force user = smbuser |
10. überprüfen unsere Eingaben auf Richtigkeit
1 |
testparm |
11. Editieren die /etc/nsswitch.conf soll dann so aussehen
1 2 3 4 5 6 7 8 9 10 |
passwd: compat winbind group: compat winbind shadow: compat hosts: files dns networks: files protocols: db files services: db files ethers: db files rpc: db files netgroup: nis |
12. PAM Konfiguration (zumindest zum Anmelden ok aber ohne korrekte shell und home) Also die /etc/pam.d/common-auth so anpassen:
1 2 3 4 5 6 |
# /etc/pam.d/common-auth – authentication settings common to all services # This file is included from other service-specific PAM config files, # and should contain a list of the authentication modules that define # the central authentication scheme for use on the system # (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the # traditional Unix authentication mechanisms. auth sufficient pam_winbind.so auth required pam_unix.so nullok_secure use_first_pass |
13. Die /etc/hosts sollte noch eine zusätzliche Zeile wie folgt bekommen
1 |
192.168.2.4 dc1.tuxclouds.local dc1 |
14. Der Domäne beitreten
1 |
net ads join -U administrator |
(Derjenige halt der Berechtigt ist ein Objekt im AD anzulegen)
15. Die Dienste wieder starten
1 2 |
/etc/init.d/samba start /etc/init.d/winbind start |
16. Funktionstest mit den Winbind Tools
1 2 3 4 |
wbinfo -t (zeigt an ob das RPC trust secret passt) wbinfo -a Administrator %Passwort (zeigt an ob sich AD-User Administrator über winbind authentisieren kann) wbinfo -u (zeigt die Active Directory Benutzer an) wbinfo -g (zeigt die Active Directory Gruppen an) |