Questa è una vecchia versione del documento!
Samba
Vedere questa ricetta per realizzare un Semplice dominio con Samba.
Per accedere a Samba conviene aprire le porte 137, 138, 139 UDP e 445 TCP.
Questi i file di configurazione da creare.
/etc/samba/smb.conf
File di configurazione principale di Samba.
[global]
netbios name = SRV_LINUX
workgroup = PARATO
server string = %h (GNU/Linux e Samba)
wins support = yes
dns proxy = no
name resolve order = lmhosts host wins bcast
log level = 3
log file = /var/log/samba/log.%m
max log size = 1000
security = user
encrypt passwords = true
null passwords = yes
lanman auth = no
passdb backend = tdbsam
username map = /etc/samba/users.map
domain logons = yes
os level = 34
local master = yes
preferred master = yes
domain master = yes
/etc/samba/users.map
Corrispondenza tra nomi di utente Linux e nomi di utente Windows. È necessario avere questo file se i nomi Windows sono “difficili” (troppo lunghi, contengono spazi, ecc.) e non sono compatibili con i nomi Linux:
!root = "Administrator" !niccolo = "Niccolò Rigacci" nobody = *
Creare un utente
Un utente Samba deve esistere sia come utente Unix/Linux sia come utente specifico Samba.
Gli utenti Unix sono elencati nel file /etc/passwd. Per vedere se esiste ad esempio l'utente nobody:
grep nobody /etc/passwd nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
Gli utenti samba sono memorizzati in /var/lib/samba/secrets.tdb, non è un file di testo, si legge con pdbedit:
pdbedit -L -w nobody:65534:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000: utente:1000:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:[U ]:LCT-00000000:
Debug e comandi di utilità
Per vedere se Samba è in esecuzione, devono esistere due processi: nmbd e smbd:
ps aux | grep mb root 11697 0.0 0.3 10636 1488 ? Ss Apr13 0:00 /usr/sbin/nmbd -D root 11700 0.0 0.7 17772 3076 ? Ss Apr13 0:00 /usr/sbin/smbd -D root 11701 0.0 0.2 17772 996 ? S Apr13 0:00 /usr/sbin/smbd -D
Per vedere se gli utenti stanno usando delle risorse condivise:
smbstatus
