To make editing configuration files easier, I wanted to be able to remotely edit them with my preferred text editor rather than using
nano via the command line. Because I'm using Hassbian for my Home Assistant installation, I used the hassbian script for setting up a Samba share.
sudo hassbian-config install samba
The script shares the
/home/homeassistant/.homeassistant directory–which contains the configuration files–to anyone on the network, but I wanted to make it a bit more secure. First, I modified the smb.conf file.
sudo nano /etc/samba/smb.conf
[homeassistant] section will be at the very end of the file. I modified it to this:
[homeassistant] path = /home/homeassistant/.homeassistant valid users = homeassistant read only = no
Finally, I added a Samba password for the
homeassistant user so the share can only be accessed by logging in as the
homeassistant user with the correct password:
sudo smbpasswd -a homeassistant
Now to access the share and edit my configuration, I'll need to enter "homeassistant" as the user and the password I chose.