Setup a Samba File Share

Setup a Samba File Share

Setting up a Samba file share server gives you an easy way to share files between your Linux server and Windows clients.

sudo apt install samba

You can either setup a public Samba share meaning anyone can read and write to and from the share, or you can setup a Samba share with authentication. You can also do a mixture of both.

Configure a Public Samba Share

If you use this option, anybody on your LAN can read and write to the share

sudo nano /etc/samba/smb.conf

Add this to the bottom of the file...

[Share]
 path = /mnt/HDD
 read only = no
 public = yes
 force user = root

Configure a Samba Share with Authentication

If you use this option, you will need to create users using the section below

sudo nano /etc/samba/smb.conf

Add this to the bottom of the file...

[Share]
 path = /mnt/HDD
 valid users = jamie
 read only = no

Create Users

To create users for the Samba share, follow these instructions. Replace user with the username you want to use

sudo smbpasswd -a *user*

Restart the Samba Service

sudo service smbd restart