Share a folder in network over SAMBA

Install and configure required software.

sudo apt-get install samba samba-common-bin

After installation configure the software.

sudo nano /etc/samba/smb.conf

Check file and make sure you have the following parameters set:

workgroup = WORKGROUP
wins support = yes

You can use anything as your workgroup name as long as it is alphanumerical and matches the workgroup you would like to join.

Setup folder to share

Сreate the folder you would like to share or use exiting.

mkdir ~/networkshare

Edit config file for setup.

sudo nano /etc/samba/smb.conf

Scroll to the bottom and add the following:

[PiShare]
 comment=Raspberry Pi Share
 path=/home/pi/networkshare
 browseable=Yes
 writeable=Yes
 only guest=no
 create mask=0777
 directory mask=0777
 public=no

Notice that public access is not allowed via “public=no” – this means that anyone wanting to access the shared folder must login with a valid user.

In this case the valid user is the user called “pi”. To let Samba know that “pi” is a network user run the command:

sudo smbpasswd -a pi

#network, #raspberrypi2, #raspbian