Cheat sheet: Install a Windows network share server (SMB/CIFS) on Ubuntu server 14.04

- Install samba12sudo apt-get install samba
- Configure sharings.
Save your samba configuration:Put the folowing into a new /etc/samba/smb.conf file12mv /etc/samba/smb.conf /etc/samba/smb.conf.SAVEand modify1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556[global]## Browsing/Identification ###workgroup = MYGROUPserver string = Samba server (%h)netbios name = Serveurdns proxy = no#### Networking #####interfaces = 192.168.0.15#bind interfaces only = yes### Access rights ###create mask = 0660directory mask = 0770#### Debugging/Accounting ####log file = /var/log/samba/log.%mmax log size = 1000syslog = 0panic action = /usr/share/samba/panic-action %d####### Authentication #######security = user# ATTENTION A BIEN REMPLACER "groupe_principal" par le nom du groupe dont vous faites partie# (si vous êtes l'utilisateur principal, c'est également votre login)# et de rajouter les éventuels autres utilisateurs...#valid users = @guest, @smbgroupencrypt passwords = truepassdb backend = tdbsamobey pam restrictions = yesunix password sync = nomap to guest = bad user############ Misc ############socket options = TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=8192 SO_SNDBUF=8192usershare allow guests = no############ SHARING 1 ############[MOVIES]comment = Movies dirpath = /mnt/moviesbrowsable = yesguest ok = noread only = nocreate mask = 0755############ SHARING 2 ############[DOCUMENTS]comment = Documents dirpath = /mnt/documentsbrowsable = yesguest ok = noread only = nocreate mask = 0755
– workgroup
– server string
– interface (put the IP of your NAS here if you want to restrict the samba listing interface)
– the name of your sharings ([MOVIES], …) and the path inside them. - Restart samba to make it take into account the configuration123sudo restart smbdsudo restart nmbd
- Add users to access the shares (note that the default passdb backends require the user to already exist in the system password file (usually /etc/passwd), else the request to add the user will fail.)12smbpasswd -a <username>
- You should be able to connect to your shared folders from a Windows/Linux computer using user <username>.