Validiert auf Ubuntu 20.04.3

NICHT funktional:

  • Management Permissions mit Computerverwaltung von Windows 11, trotz zugewiesenem SeDiskOperatorPrivilege und gesetzter Einstellung acl_xattr:ignore system acls = yes
  • ACLs mit SSSD ==> Gruppenauflösung funktionierte nicht
  • bei aktivierter Preview-Pane im Explorer entsteht ein lock-Problem, Dateien ließen sich nicht überschreiben

Konfiguration:

  1. Samba installieren
    1. 20.04.3:
      apt-get install acl attr samba samba-dsdb-modules samba-vfs-modules winbind libpam-winbind libnss-winbind libpam-krb5 krb5-config krb5-user ntpd
    2. 22.04.1
      apt-get install acl attr samba samba-dsdb-modules samba-vfs-modules winbind libpam-winbind libnss-winbind libpam-krb5 krb5-config krb5-user
  2. /etc/krb5.conf editieren und Inhalt setzen auf:
    [libdefaults]
    default_realm = <AD.DOMAIN>
    dns_lookup_realm = false
    dns_lookup_kdc = true
  3. /etc/hosts editieren, Zeile 127.0.0.1 setzen (Reihenfolge beibehalten, nur 1 Zeile, auch bei 22.04):
    127.0.0.1 <fqdn> <hostname> localhost
  4. /etc/samba/smb.conf editieren (rid-Backend; alternativ ad - testen bei Fileserver-Deployments wg. UID! - https://wiki.samba.org/index.php/Idmap_config_ad):

    [global]
    workgroup = <SAM-Domäne>
    security = ads
    realm = <AD.DOMAIN>
    winbind refresh tickets = Yes
    vfs objects = acl_xattr
    map acl inherit = Yes
    store dos attributes = Yes
    dedicated keytab file = /etc/krb5.keytab
    kerberos method = secrets and keytab

    ;nur eine Domai LTSn:
    winbind use default domain = yes

    ;ID mapping
    idmap config * : backend = tdb
    idmap config * : range = 3000-7999
    idmap config SAMDOM : backend = rid
    idmap config SAMDOM : range = 10000-999999

    ;Konteneinstellung
    template shell = /bin/bash
    template homedir = /home/%U

    ;nur fuer getent:
    ;winbind enum users = yes
    ;winbind enum groups = yes

    ;Drucken deaktiviert
    load printers = no
    printing = bsd
    printcap name = /dev/null
    disable spoolss = yes

    ;Protokoll
    log file = /var/log/samba/log.%m
    log level = 1
    max log size = 1000
    logging = file
    panic action = /use/share/samba/panic-action %d

  5. net ads join -U <admin-user>
  6.  /etc/nsswitch.conf editieren, winbind bei passwd: und group: hinten anfügen (Leerzeichen-getrennte Liste)
  7.  Shares hinzufügen:
    [share-name]
    path = <path>
    read only = no
    valid users = @<SAM-DOMÄNE\gruppe> <SAM-DOMÄNE\benutzer>
  8. wichtig: Pfad ACLs setzen. Default-ACLs arbeiten auf Datesystemsebene und sind daher robuster als irgendwelche Einstellungen von Samba:
    setfacl -m u:<user>:rwx,g:<group>:rwx,g:group:- <verz>
    ==> setfacl -d -m... für defaulttrechte, die werden vererbt