Questo tutorial spiega l'installazione di un file server Samba su Debian Etch e come configurarlo per condividere file tramite il protocollo SMB e aggiungere utenti. Samba è configurato come server autonomo, non come controller di dominio. Per configurare Samba come controller di dominio, dai un'occhiata a questo howto:https://www.howtoforge.com/samba_domaincontroller_setup_ubuntu_6.10
Nella configurazione risultante, ogni utente ha la propria home directory accessibile tramite il protocollo SMB e tutti gli utenti hanno una directory condivisa con accesso in lettura/scrittura.
Installazione di Samba
Installa i pacchetti Debian Samba:
apt-get install libcupsys2 samba samba-common
Rispondi alle seguenti domande:
Please specify the workgroup you want this server to appear to be in when queried by clients. Note that this parameter also controls the domain name used with the security=domain setting.
Workgroup/Domain Name:
-> gruppo di lavoro
If your computer gets IP address information from a DHCP server on the network, the DHCP server may also provide information about WINS servers ("NetBIOS name â servers") present on the network. This requires a change to your smb.conf file so that DHCP-provided WINS settings will automatically be read from /etc/samba/dhcp.conf.
The dhcp3-client package must be installed to take advantage of this feature.
Modify smb.conf to use WINS settings from DHCP?
-> no
Modifica il file smb.conf:
vi /etc/samba/smb.conf
Nella sezione globale, rimuovi ";" all'inizio della riga security =user quindi appare così:
security = user
per consentire agli utenti del sistema Linux di accedere al server Samba.
Nella sezione [case] cambia scrivibile =no a:
writable = yes
Chiudi il file e riavvia Samba:
/etc/init.d/samba restart
Ora aggiungerò una condivisione accessibile a tutti gli utenti.
Crea la directory per condividere i file e cambia il proprietario nel gruppo utenti.
mkdir -p /home/shares/allusers
chown -R root:users /home/shares/allusers/
chmod -R ug+rwx,o+rx-w /home/shares/allusers/
Alla fine del file /etc/samba/smb.conf aggiungi le seguenti righe:
[allusers] comment = All Users path = /home/shares/allusers valid users = @users force group = users create mask = 0660 directory mask = 0771 writable = yes
Ora riavviamo Samba:
/etc/init.d/samba restart
Aggiunta e gestione degli utenti
In questo esempio, aggiungerò un utente chiamato tom. Puoi aggiungere tutti gli utenti di cui hai bisogno allo stesso modo, basta sostituire il nome utente tom con il nome utente desiderato nei comandi.
useradd tom -m -G users
Ora aggiungi l'utente al database degli utenti di Samba.
smbpasswd -a tom
-> Inserisci la password per il nuovo utente
Ora dovresti essere in grado di accedere dalla tua workstation Windows con Esplora file utilizzando il nome utente tom e la password scelta e archiviare i file sul server Linux nella home directory di tom o nella directory condivisa pubblica.
Link
- http://www.debian.org
- http://www.samba.org