Install Samba file server for Windows


Samba file server enables specified directories to be accessible by Windows computers on the same network.


Install the package​:​

$ sudo apt-get update $ sudo apt-get install samba

Define a workgroup

Edit the config file:

$ gksudo gedit /etc/samba/smb.conf

​​​​​Define workgroup name as "kctcl" in the "[global]" section:

workgroup = kctcl

Uncomment to restrict access to server users only:

security = user

Define directories to be shared

Add a section at the end to share directories:

[<sub-directory name or other short name>]
   pth = /<directory name>/<sub-directory name>
   browseable = yes
   guest ok = yes
   read only = no
   create mask = 0775
   directory mask = 0775
   force user = nobody
   force group = nogroup

Create the directory to be shared, if not already existing:

$ sudo mkdir -p /<directory name>/<sub-directory name>

Change ownership of the directory:

$ sudo chown nobody:nogroup /<directory name>/<sub-directory name>

Start service

Start or restart Samba service whenever the config file is changed:

$ sudo systemctl restart smbd nmbd

or, if ".service" is not automatically appended when executing the above command:

$ sudo systemctl restart smbd.service nmbd.service