smbd
e nmbd
.
dpkg-reconfigure samba-common samba
.
FALCOTNET
). Un'altra domanda chiederà se le password dovranno essere cifrate. La risposta è che dovranno esserlo poiché si tratta di un requisito per la maggior parte dei client Windows moderni, inoltre questo aumenta la sicurezza. Il rovescio della medaglia è che ciò richiede di gestire le password Samba separatamente dalle password Unix.
inetd
or as stand-alone daemons. Using inetd
is only interesting when Samba is rarely used; the Falcot administrators therefore picked stand-alone daemons.
/etc/samba/smb.conf
. Gli estratti seguenti riassumono le modifiche applicate alla sezione [global]
.
[global] ## Browsing/Identification ### # Change this to the workgroup/NT-domain name your Samba server will part of workgroup = FALCOTNET # server string is the equivalent of the NT Description field server string = %h server (Samba %v) # Windows Internet Name Serving Support Section: # WINS Support - Tells the NMBD component of Samba to enable its WINS Server wins support = yes[...] ####### Authentication ####### # "security = user" is always a good idea. This will require a Unix account # in this server for every user accessing the server. See # /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html # in the samba-doc package for details. security = user
# You may wish to use password encryption. See the section on # 'encrypt passwords' in the smb.conf(5) manpage before enabling. encrypt passwords = true # If you are using encrypted passwords, Samba will need to know what # password database type you are using. passdb backend = tdbsam [...] ########## Printing ########## # If you want to automatically load your printer list rather # than setting them up individually then you'll need this load printers = yes
# lpr(ng) printing. You may wish to override the location of the # printcap file ; printing = bsd ; printcap name = /etc/printcap # CUPS printing. See also the cupsaddsmb(8) manpage in the # cups-client package. printing = cups
printcap name = cups
Indica che Samba agirà come name server Netbios (WINS) per la rete locale.
| |
Questo è il valore predefinito per questo parametro. Ad ogni modo, poiché è un punto chiave per la configurazione di Samba, è raccomandato indicare esplicitamente la propria scelta. Ogni utente deve autenticarsi prima di accedere a qualsiasi condivisione.
| |
Comunica a Samba di condividere automaticamente tutte le stampanti locali configurate su CUPS. Rimane possibile restringere l'accesso a queste stampanti aggiungendo delle sezioni appropriate.
| |
Specifica il sistema di stampa in uso, CUPS nel nostro caso.
|
adduser
).
smbpasswd -a utente
: questo comando chiede di inserire la password in modalità interattiva.
smbpasswd -x utente
. Un account Samba può anche essere disabilitato temporaneamente con smbpasswd -d utente
ed essere riabilitato in seguito con smbpasswd -e utente
.
[global]
del file di configurazione:
domain logons = yespreferred master = yes logon path = \\%L\profiles\%U
logon script = scripts/logon.bat
Abilita la funzionalità controller di dominio
| |
Specifica la posizione delle directory home per gli utenti. Queste sono conservate in una condivisione dedicata, cosa che permette di abilitare opzioni specifiche (in particolare le acl per il profilo , un requisito per la compatibilità con Windows 2000, XP e Vista).
| |
Specifica lo script batch (non interattivo) che sarà eseguito sulla macchina Windows client ogniqualvolta viene aperta una sessione. In questo caso /var/lib/samba/netlogon/scripts/logon.bat . Lo script dev'essere in formato DOS dove le linee sono separate da un carattere di ritorno carrello e da un carattere per l'avanzamento di riga. Se il file è stato creato con Linux eseguire unix2dos lo convertirà.
I comandi utilizzati più comunemente in questi script permettono la creazione automatica dei dischi di rete e la sincronizzazione di data ed ora sul sistema.
|
[netlogon] comment = Network Logon Service path = /var/lib/samba/netlogon guest ok = yes writable = no share modes = no [profiles] comment = Profile Share path = /var/lib/samba/profiles read only = No profile acls = Yes
/var/lib/samba/profiles/utente
) ed ognuna dev'essere di proprietà dell'utente corrispondente.
smbclient
interroga i server SMB. Accetta una opzione -U utente
per connettersi al server attraverso una specifica identità. smbclient //server/condivisione
accede alla condivisione con una modalità interattiva simile alla riga di comando dei client FTP. smbclient -L server
elenca tutte le condivisioni disponibili (e visibili) sul server.
mount
command allows mounting a Windows share into the Linux filesystem hierarchy (with the help of mount.cifs
provided by cifs-utils).
Esempio 11.28. Montare una condivisione Windows
mount -t cifs //arrakis/shared /shared \ -o credentials=/etc/smb-credentials
/etc/smb-credentials
file (which must not be readable by users) has the following format:
username = utente password = password
uid
and gid
allow forcing the owner and group of files available on the mount, so as not to restrict access to root.
/etc/fstab
:
//server/shared /shared cifs credentials=/etc/smb-credentials
umount
command.
http://localhost:631/admin
smb://utente:password@server/stampante
.