#!/bin/bash source ./zamba.conf apt update && apt full-upgrade -y echo -ne '\n' | apt install -y $LXC_TOOLSET acl samba winbind libpam-winbind libnss-winbind krb5-user krb5-config samba-dsdb-modules samba-vfs-modules mv /etc/krb5.conf /etc/krb5.conf.bak cat > /etc/krb5.conf < /etc/samba/smb.conf <> /etc/pam.d/common-session systemctl restart winbind nmbd wbinfo -u wbinfo -g mkdir /$LXC_FILEFS_MOUNTPOINT/$ZMB_SHARE # originally 'domain users' was set, added variable for domain admins group, samba wiki recommends separate group e.g. 'unix admins' chown "$ZMB_ADMIN_USER":"$ZMB_DOMAIN_ADMINS_GROUP" /$LXC_FILEFS_MOUNTPOINT/$ZMB_SHARE setfacl -Rm u:$ZMB_ADMIN_USER:rwx,g::-,o::- /$LXC_FILEFS_MOUNTPOINT/$ZMB_SHARE setfacl -Rdm u:$ZMB_ADMIN_USER:rwx,g::-,o::- /$LXC_FILEFS_MOUNTPOINT/$ZMB_SHARE systemctl restart smbd nmbd winbind