[SOLVED] Adding user to access openhab samba shares?

  • Platform information:
    • Hardware: RPI 3 B+
    • OS: Openhabian
    • Java Runtime Environment: which java platform is used and what version
    • openHAB version: OpenHAB 2.3.0-1

Hey all, I just did a fresh install of openhabian onto my rpi3 b+ then updated openhab to 2.3.0-1
after that I ran this command to create a new samba user:

sudo adduser --no-create-home --disabled-login <username>

followed by this one to set the password:

sudo smbpasswd -a <username>

then I ran this command to add my new user to the group openhab:

sudo usermod -a -G <groupname> <username>

I can access the shares just fine but I can’t write to them if I connect with my new user account, but if i connect as openhabian I can. I’m sure there needs to a permission edited somewhere to allow the new account the write to the shares.

Anyone have an idea on how to fix this (permissions have always been something difficult for me to wrap my head around).

Thanks to anyone that could help me out, I’d really appreciate it.

You can try give permissions using chmod.

g+w — adds write access for the group

o-rwx — removes all permissions for others

u+x — allows the file owner to execute the file

a+rw — allows everyone to read and write to the file

ug+r — allows the owner and group to read the file

sudo chmod g+w var/lib/openhab2 This example will allow write access to var/lib/openhab2

Here is a link that may help with permissions

https://www.thegeekdiary.com/linux-file-directory-permissions-cheat-sheet/

Thank you so much, got it working in a jiffy, Thanks again