logo rss

Configuration rapide d'un partage Samba

Voici une procédure volontairement ultra simpliste à suivre pour mettre rapidement en place un serveur de partage de fichiers avec Samba sous Debian Linux. Le but ici n'est pas de parcourir les nombreuses options de Samba mais d'avoir un partage de fichiers opérationnel le plus rapidement possible.

Configuration

  • OS : Debian GNU/Linux 10 (buster)
  • samba : 4.9.5

Installation

root@host:~# apt-get install samba

Samba configuration minimale

Configuration réseau

  • /etc/network/interface
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
# This is an autoconfigured IPv6 interface
allow-hotplug eth0
iface eth0 inet static
	address 10.0.0.200
	netmask 255.255.255.0
	gateway 10.0.0.254
root@host:~# reboot

Créer le répertoire de partage

root@host:~# mkdir /share

Créer un utilisateur samba

root@host:~# adduser --home /share --system samba

Paramétrer les droits

root@host:~# chown samba: /share
root@host:~# smbpasswd -a samba

/etc/samba/smb.conf

[global]
   workgroup = WORKGROUP
   server string = serv01
[share]
   path = /share
   read only = no
   valid users = samba

Vérification de la configuration et redémarrage des services

root@host:~# testparm
root@host:~# systemctl restart smbd; systemctl restart nmbd
Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.

Contact :

adresse mail de contact