@Skeletor
When you say
Are you referring to your user account you have created on FreeNAS?
There’s more than a few ways to set up permissions and I only know some basic in this regard.
I think the easiest thing is to use the group permission. (NOT inside the jail, use the FreeNAS GUI)
- On your FreeNAS create the
hass
group with a GUID = 8123
- Add the
hass
group to your FreeNAS user account
Also you mention NFS share. I’m using samba shares. Either one should work but something to keep in mind. You’ll see in the guide when I’m setting up the share I added some directory and file create masks to the samba share settings. This causes new file to be created already having the group permission set to read/write. By default new files will only allow the group the have read permission. This means if you create or copy a new file into the homeassistant directory, HA (technically hass, the user running HA) will be able to read the file but may not be able to save any changes it makes to the file. These create masks only apply to samba shares though. You may need to take addition steps or use the configurator to create new files.
For example if I make two file in my HA directory, One using samba share and the other over ssh you see the difference in default permissions as the file have been created. Only the file created over samba has group RW set.
The configurator is run by user hass
as well and can further illustrate. In other words, Home Assistant has the same permissions to read or write files as the configurator dose because they are both run by the same user.
The file created over samba
The file created over ssh
If at any time you need to fix your permissions for HA, while not required, I find the best results doing so from inside the homeassistant jail since that’s where the main hass
user exists and where HA is running. I’ll fix up the file __NEW_FILE_OVER_SSH
as a quick example
iocage console homeassistant
chown hass:hass /home/hass/homeassistant/__NEW_FILE_OVER_SSH
- Set group permissions (While there are numerous ways to do this, I think this is most simple and to the point. I don’t always want RW permissions for the group. What I actually want is the group to have the same permission the user has, so I use “group = user”
chmod g=u /home/hass/homeassistant/__NEW_FILE_OVER_SSH
And now the resulting permissions
These are the same commands but would set the entire homeassistant directory and everything in it
chown -R hass:hass /home/hass/homeassistant
chmod -R g=u /home/hass/homeassistant
You can work around all this as well by simply creating new files using the configurator.
This results correct file permissions as they will be owned by hass
with RW for group
To be clear that applies to creating new files. If I create an empty file with configurator, it has been created with the proper permissions. Now I can still even open and edit the file over ssh and safely save changes. It will not break or takeaway the group RW permission once they have been properly set
Hope that helps!