Hallo Leute!

Im Büro haben wir zwei Server, mit Debian 11, bei denen Samba mit unserem AD spricht. Das Ziel ist, dass die Nutzer im AD auch die Samba-Shares auf den Server nutzen können.

Dafür wurde Samba so eingerichtet:
-------------------------
[global]
        server string = NAS Mediaserver
        interfaces = lo, eno1
        bind interfaces only = yes
        wins server = ad.mycompany.intra
        name resolve order = wins, host
        multicast dns register = no
        enable core files = no
        log file = /var/log/samba/log.%m
        log level = 1
        deadtime = 15
        disable netbios = yes
        lm announce = no
        local master = no
        enhanced browsing = no
        reset on zero vc = yes
        kernel share modes = no
        posix locking = no
        strict locking = no
        use sendfile = yes
        async smb echo handler = yes
        host msdfs = no
        csc policy = disable

        case sensitive = yes
        mangled names = no
        hide unreadable = yes
        hide files = /lost+found/
        hide dot files = no
veto files = /.DS_Store/._.DS_Store/._.TemporaryItems/.TemporaryItems/Thumbs.db/
        delete veto files = yes

        workgroup = AD-MYCOMPANY-INTRA
        realm = AD.MYCOMPANY.INTRA
        server role = MEMBER
        server services = +smb
        security = ADS
        kerberos method = system keytab
        obey pam restrictions = no
        map to guest = Bad User
        guest account = nobody
        client signing = auto
        client min protocol = NT1
        server signing = auto
        server min protocol = NT1
        create krb5 conf = no
        acl map full control = no
        idmap config * : range = 2000-10000
        idmap config AD-MYCOMPANY-INTRA : backend = ad
        idmap config AD-MYCOMPANY-INTRA : range = 200000-1000200000
        idmap config AD-MYCOMPANY-INTRA : unix_primary_group = yes
        idmap config AD-MYCOMPANY-INTRA : schema_mode = rfc2307
        winbind cache time = 600
        winbind enum users = yes
        winbind enum groups = yes
        winbind refresh tickets = yes
        winbind use default domain = true
        winbind nss info = rfc2307
        utmp = no
-------------------------

Danach wurde der Server in den AD angemeldet:

realm discover AD.MYCOMPANY.INTRA
realm join AD.MYCOMPANY.INTRA

Nun zu dem Problem...
Die Kommunikation läuft und die Nutzer können die Samba-Shares auf dem Server nutzen. Eine Weile lang.
Bis dann plötzlich das Ganze nicht mehr geht... :(

Auf dem AD sehen wir Haufen Meldungen wie:
-------------------------
               Client Name: \\10.0.31.72
               Client Address: 10.0.31.72:40998
               User Name:
               Session ID: 0x880128000015
Status: The attempted logon is invalid. This is either due to a bad username or authentication
               information. (0xC000006D)
               SPN: session setup failed before the SPN could be queried
               SPN Validation Policy: SPN optional / no validation
-------------------------
und in Samba sehe ich:
-------------------------
[2021/08/25 09:03:24.542270, 1] ../../lib/ldb-samba/ldb_wrap.c:79(ldb_wrap_debug) ldb: Unable to open tdb '/var/lib/samba/private/secrets.ldb': No such file or directory [2021/08/25 09:03:24.542363, 1] ../../lib/ldb-samba/ldb_wrap.c:79(ldb_wrap_debug) ldb: Failed to connect to '/var/lib/samba/private/secrets.ldb' with backend 'tdb': Unable to open tdb '/var/lib/samba/private/secrets.ldb': No such file or directory [2021/08/25 09:03:24.696081, 1] ../../source3/winbindd/winbindd_cm.c:1163(cm_prepare_connection) authenticated session setup to ad.mycompany.intra using AD-MYCOMPANY-INTRA\NASMEDIA02$ failed with NT_STATUS_LOGON_FAILURE [2021/08/25 09:03:24.696405, 1] ../../source3/winbindd/winbindd_cm.c:1309(cm_prepare_connection) Failed to prepare SMB connection to ad02.ad.queo.org: NT_STATUS_LOGON_FAILURE
-------------------------

In dem Moment können wir auch mit wbinfo -u kein AD-Nutzer mehr sehen. Kurioserweise liefert aber wbinfo -g die Gruppen... Bisher die vorläufige Lösung, die ich gefunden habe, ist Samba neustarten, Winbind stoppen, net ads join wiederholen und schließlich Winbind wieder starten.
Das ist aber keine Lösung.

Hat jemand eine Idee, was das Problem ist und wie wir das endgültig lösen können?
Andere Server, mit Debian 10, haben das Problem überhaupt nicht.

Danke für eure Hilfe!
Luca Bertoncello
([email protected])

Antwort per Email an