Installation de Samba : Répertoire réseau partagé

Installation de Samba : Répertoire réseau partagé.

1) Installation de Samba :

[~] ➔ sudo apt-get install samba samba-common-bin

2) Création d’un utilisateur :

[~] ➔ sudo adduser util01
[~] ➔ sudo pdbedit -a util01
[~] ➔ sudo smbpasswd util01

3) Création d’un partage :

[~] ➔ su util01
Mot de passe : 
util01@raspberrypi /home/pi $ cd
util01@raspberrypi ~ $ mkdir partage
util01@raspberrypi ~ $ ls -l
total 4
drwxr-xr-x 2 util01 util01 4096 juin  13 23:52 partage
util01@raspberrypi ~ $ exit
[~] ➔ 

4) Configuration de Samba :

– Sauvegarde du fichier de base :

[~] ➔ sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.orig

– Configuration :

Ouvrir :

/etc/samba/smb.conf

Ajouter :

[global]
   workgroup = RESEAU01
   server string = %h server
   netbios name = RASPBERRY
   dns proxy = no
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
   security = user
   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
   usershare allow guests = yes

[Util01]
   browseable = yes
   path = /home/util01/partage
   writable = yes
   username = util01
   only user = yes
   create mode = 0600
   directory mask = 0700

– Redémarrage :

[~] ➔ sudo /etc/init.d/samba restart

5) Test : A partir d’un autre ordinateur du réseau :

– Liste des partages :

[~] ➔ smbclient -L 192.168.1.12
Enter util01's password: 
Domain=[RESEAU01] OS=[Unix] Server=[Samba 3.6.6]

	Sharename       Type      Comment
	---------       ----      -------
	Util01          Disk      
	IPC$            IPC       IPC Service (raspberrypi server)
Domain=[RESEAU01] OS=[Unix] Server=[Samba 3.6.6]

	Server               Comment
	---------            -------
	RASPBERRY            raspberrypi server

	Workgroup            Master
	---------            -------
	RESEAU01             RASPBERRY
	WORKGROUP            LIVEBOX

– Connexion au partage :

[~] ➔ smbclient \\\\192.168.1.12\\Util01
Enter util01's password: 
Domain=[RESEAU01] OS=[Unix] Server=[Samba 3.6.6]
smb: \> ls
  .                                   D        0  Sun Jun 14 00:14:36 2015
  ..                                  D        0  Sat Jun 13 23:53:04 2015
  archive                             D        0  Sun Jun 14 00:14:33 2015
  PARTAGE_Util01                               0  Sun Jun 14 00:02:16 2015

		59665 blocks of size 262144. 18806 blocks available
smb: \>