Samba : File server

Dans Proxmox

apt install samba winbind krb5-user libnss-winbind libpam-winbind libpam-krb5

(winbindd sous bullseye)

nano /etc/krb5.conf

et ajouter les lignes suivantes

[libdefaults]
default_realm = SAMDOM.EXAMPLE.COM
dns_lookup_realm = false
dns_lookup_kdc = true

Tester avec la commande kinit

kinit administrator

Fermer les services smbd/nmbd et supprimer le fichier smb.conf:

service smbd stop service nmbd stop rm /etc/samba/smb.conf

Créer un fichier de configuration:

nano /etc/samba/smb.conf

avec le contenu suivant:

[global]
workgroup = MAKEITSIMPLE
security = ADS
realm = MAKEITSIMPLE.LAN
idmap config *:backend = tdb
idmap config *:range = 700001-800000
idmap config MYDOMAIN:backend = ad
idmap config MYDOMAIN:schema_mode = rfc2307
idmap config MYDOMAIN:range = 500-700000
winbind nss info = rfc2307
vfs objects = acl_xattr
map acl inherit = Yes
winbind use default domain = yes
winbind enum users = yes
winbind enum groups = yes
template homedir = /homes/%U
printcap name = /dev/null
load printers = no
disable spoolss = yes
printing = bsd
[dossier]
path = /srv/dossier
read only = no

Rejoindre le domaine:

net ads join -U administrator

Editer le fichier nsswitch:

nano /etc/nsswitch.conf

Et rajouter winbind:

passwd: files systemd winbind
group: files systemd winbind
<code>
- Faire quelques tests: <code bash>
wbinfo -u
wbinfo -g
wbinfo -i administrator

Assigner les droits sur le dossier:

chown administrator:"domain users" /srv/dossier chmod 770 /srv/dossier

Problème avec les DB Foxpro (ex: Winbooks)

[volume] path = /volume force group = superuser create mask = 0775 directory mask = 0775 veto oplock files = /*.dbf/*.DBF/*.ndx/*.NDX/*.dbx/*.DBX/*.dbt/*.DBT/*.cdx/*.CDX/

Sources

https://wiki.samba.org/index.php/Setting_up_Samba_as_a_Domain_Member

https://www.linuxquestions.org/questions/linux-server-73/running-foxpro-app-and-database-on-samba-sluggish-930743/