Friday, March 18, 2016

Samba

Setup Samba

Install Samba
Next, we’ll install Samba and share the configuration and user folders – this will make it easier to install add-ons and change the sitemap remotely.
sudo nano /etc/samba/smb.conf
Change the workgroup name if needed, but otherwise enable WINS support:
wins support = yes
(you’ll need to uncomment the line, and change no to yes)
then add the following to the share definitions section (scroll all the way down to the bottom of the long file):
[OpenHAB Home]
 comment= OpenHAB Home
 path=/usr/share/openhab

 browseable=Yes
 writeable=Yes
 only guest=no
 create mask=0777
 directory mask=0777
 public=no
[OpenHAB Config]
 comment= OpenHAB Site Config
 path=/opt/openhab
 browseable=Yes
 writeable=Yes
 only guest=no
 create mask=0777
 directory mask=0777
 public=no
I also commented out the Printers section. I’ve made two shares, since the configuration files are actually stored separately to the add-ons.
Save and exit. We finally need to set a Samba password for the openhab user:
sudo smbpasswd -a openhab
I’d suggest “openhab” as the password just for ease of use, but it doesn’t really matter.
Thanks to reader David L – it appears the method of restarting Samba has changed in the latest Raspian. Here’s the updated instructions:
sudo update-rc.d smbd enable
sudo update-rc.d nmbd enable
sudo service smbd restart
After restarting Samba (older installs use sudo service samba restart), test you can access the shared drive.
It might not be auto-discovered on a Mac; but you can use the
Finder -> Go -> Connect to Server and the address
smb://openhab@raspberrypi.local
Or, try address smb://openhab@192.168.1.80
Authenticate with username openhab and your chosen password, then open up both your shares to have a look around.  Select OpenHAB Config and OpenHAB Home.  It should open windows for both directories

No comments:

Post a Comment