Ubuntu 16.04 LTS – How To Install and Configure SAMBA

This guide explains how to configure samba server in Ubuntu 16.04 with anonymous & secured samba servers. Samba is an Open Source/Free Software suite that provides seamless file and print services to SMB/CIFS clients. Samba is freely available, unlike other SMB/CIFS implementations, and allows for interoperability between Linux/Unix servers and Windows-based clients. I’ll be logged in as root.

Step 1 – Update repositories.

root@mail:/# apt-get update
root@mail:/# apt-get upgrade

Step 2 – Install samba.

root@mail:/# apt-get install samba

Step 3 – Backup config file .

root@mail:/# cp /etc/samba/smb.conf /etc/samba/smb.conf.backup

Main Configuration

Step 4 – Open config file.

root@mail:/# nano /etc/samba/smb.conf

Step 5 – Configuration of Samba server.
1 – [global] – The rules defined here apply for all shared folders
2 – follow symlinks = yes //allow using shortcut
3 – unix extensions – no //denied using unix extention
4 – [ftp] // name of share
5 – path = /srv/samba/ftp //path of share
6 – create mask = 0775

   – force create mode = 0775
   – directory mask = 0775
   – force create mode = 0775 // These are the permissions, which will be used for creation of files and folders. In this way the files and folders will be edited only by the users of the particular group. If you want these files and folders to be edited by all users, you have to change the permissions to 777
7 -valid users
   – write list = mslavov // The users who will have permission to write in this directory
8 – [yoursharedfolder]
   – comment = yoursharedfolder
   – path = /srv/samba/yoursharedfolder //If you want to create your own shared folder, you just have to change the folders names with your folders names and to add the rules which you want for your folder.

This is mine config file.

follow symlinks = yes
wide links = yes
unix extensions = no

comment = ftp
path = /srv/samba/ftp
browseable = yes
valid users = mslavov, YOURUSER, test, test1
write list = mslavov, YOURUSER, test, test1
create mask = 0775
force create mode = 0775
public = no
guest only = no
directory mask = 0775
force directory mode = 0775
store dos attributes = Yes
hide unreadable = yes
hide files = /examples.desktop

comment = yoursharedfolder
path = /srv/samba/yoursharedfolder

Step 6 – Add users in Samba Server and after that add the user for particular folder in config file /etc/samba/smb.conf. Then you must restart samba service.

root@mail:/# smbpasswd -a youruser

Step 7 – Now you must restart samba service.


Step 8 – Check samba status.

Step 9 – Create folder for your share and give full right.

root@mail:/# mkdir /etc/samba/ftp
root@mail:/# chmod 777 /etc/samba/ftp

Step 10 – Add share folder on Windows.
My Computer -> Map network drive -> \\Ip address of samba server\\name of your shared folder -> add your samba user and password.

8 ThemeHow to create script for BACKUP and use crontab on Ubuntu (Server) 14.04 LTS Step-by-Step

Leave a Reply

Your email address will not be published. Required fields are marked *