Software – Samba

In order to deploy and modify our python and php scripts it is useful to have samba installed on the headless pi, so you can edit the scripts in your favourite text editor on the desktop.

First create a directory for the python scripts…

cd /usr/local/bin
sudo mkdir -p code/controller

set the ownership…

sudo chown -R pi:pi code

update the operating system…

sudo apt-get update

install samba…

sudo apt-get install samba samba-common-bin

then edit the configuration…

sudo nano /etc/samba/smb.conf

Place this section at the end of the config file, and save.

[controller] comment = controller code repository
path = /usr/local/bin/code/controller
writeable = yes
guest ok = no

Give the user pi permissions…

sudo smbpasswd -a pi

you will be prompted to enter a password.

Restart samba.

sudo /etc/init.d/samba restart

You should now be able to explore the pi’s directories:

I have found that Windows 10 requires a credential to be set up in advance, in order to explore the samba shares. In addition, the home directory for the pi user is set to read-only on samba installation, so you may want to change this in the configuration file.

The next requirement is a database server.