Ver esto: https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Domain_Member#Configuring_Samba

y esto: https://www.server-world.info/en/note?os=Ubuntu_20.04&p=samba&f=4

Es importante agregar el nameserver en netplan


apt -y install winbind libpam-winbind libnss-winbind krb5-config samba-dsdb-modules samba-vfs-modules

Copiar un backup de /etc/samba/smb.conf porque queda así:

testparm devuelve si hay errores en el smb.conf y la configuración activa

[global]
        disable spoolss = Yes
        kerberos method = secrets and keytab
        load printers = No
        log file = /var/log/samba/log.%m
        logging = file
        map to guest = Bad User
        max log size = 1000
        obey pam restrictions = Yes
        pam password change = Yes
        panic action = /usr/share/samba/panic-action %d
        passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
        passwd program = /usr/bin/passwd %u
        printcap name = /dev/null
        realm = BCCBA.ORG.AR
        security = ADS
        server role = member server
        server string = %h server (Samba, Ubuntu)
        unix password sync = Yes
        usershare allow guests = Yes
        winbind refresh tickets = Yes
        winbind use default domain = Yes
        workgroup = BCCBA
        idmap config bccba : range = 100000-999999
        idmap config bccba : backend = tdb
        idmap config * : range = 3000-7999
        idmap config * : backend = tdb
        map acl inherit = Yes
        printing = bsd
        vfs objects = acl_xattr


[print$]
        comment = Printer Drivers
        path = /var/lib/samba/printers


[RAID1]
        comment = Carpeta de prueba
        create mask = 0660
        directory mask = 0770
        path = /mnt/hdd
        read only = No
        valid users = "@BCCBA\domain admins"


[temp]
        comment = test
        guest ok = Yes
        path = /tmp/temp

En /etc/nsswitch.conf indica que hay que cambiar sss por winbind, pero probar si funciona el inicio de sesión